Jump to content

Display table on mouseover through echo


sihl

Recommended Posts

I am trying to get a javascript mouseover to pop up and show a table. I have the array set here:

 

	1	=> array(92005,1,800,5,'<table><tr><td>Hello</td></tr></table>','icon_1'),

 

Then I am trying to call for it here:

 

		echo "{$value[1]} x <a class=\"q{$value[3]}\" href=\"javascript:;\" onmouseover=\"$WowheadPower.showTooltip(event, {$value[4]}, {$value[5]})\" onmousemove=\"$WowheadPower.moveTooltip(event)\" onmouseout=\"$WowheadPower.hideTooltip();\"\>{$reward_texts[$langs[$set_lang][2]][$key]}</a>";

 

But it does not show up. I can go to the page but when I mouseover the link nothing pops up. Although I know it is trying to work, because I can see the link as "javascript:;"

 

Additionally, here is the full function:

 

function show_rewards()
{
global $langs, $language, $reward_texts, $set_lang, $tab_rewards;
echo "<script type=\"text/javascript\" src=\"http://wow-covenant.org/power.js\"></script>
<table border=\"1\" cellspacing=\"1\" cellpadding=\"3\" align=\"center\">
<tr>
	<th colspan=\"3\">",$language["available_rewards"],"</th>
</tr>";
foreach($tab_rewards as $key => $value)
{
	if($value[2] > $_SESSION["points"])
		$disabled = " disabled=\"disabled\"";
	else
		$disabled = "";
	echo "<form action=\"index.php\" method=\"post\"><input type=\"hidden\" name=\"reward\" value=\"",$key,"\" />
	<tr><td align=\"left\">";
	if($value[0] && $value[3] >= 0)
	echo "{$value[1]} x <a class=\"q{$value[3]}\" href=\"javascript:;\" onmouseover=\"$WowheadPower.showTooltip(event, {$value[4]}, {$value[5]})\" onmousemove=\"$WowheadPower.moveTooltip(event)\" onmouseout=\"$WowheadPower.hideTooltip();\"\>{$reward_texts[$langs[$set_lang][2]][$key]}</a>";
	else
		echo $reward_texts[$langs[$set_lang][2]][$key];
	echo "</td>
	<td>",$value[2]," ",$language["points_2"],"</td>
	<td><input type=\"submit\" name=\"submit\" value=\"",$language["choose"],"\"",$disabled," /></td></tr></form>";
}
echo "</table>";
}

Link to comment
https://forums.phpfreaks.com/topic/193207-display-table-on-mouseover-through-echo/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.