div没有显示onmouseover

时间:2012-02-02 21:18:16

标签: php javascript onmouseover

一切都很完美吧div'隐藏表'没有显示,如果我删除'style:display:none'然后它显示正确数据的表,所以我知道它的工作,我尝试了弹出窗口回声和单独显示它只是为了看它是否显示它的作用。

似乎只有当它在回声中并且似乎以'onmousover'

为中心时才会出现问题

整页代码:

<html>




  <table border='0' cellpadding='0' cellspacing='0' class="center2">
  <tr>
  <td width='60'><img src="images/box_tl.png"></td>
  <td style="background: url(images/box_tm.png)" align="center"><img src="images/news.png"></td>
  <td width='25'><img src="images/box_tr.png"></td>
  </tr>
  <tr>
  <td style="background: url(images/box_ml.png)"><h2>.</h2></td>
  <td style="background: url(images/box_mm.png)">


 <?php
include 'connect.php';

$query = mysql_query("SELECT * FROM tbl_img") or die(mysql_error());;

echo "<table border='0' cellpadding='1' cellspacing='1' width'90%' id='1' class='tablesorter'><thead>";
echo "<tr> <th> </th> <th>Mob Name</th> <th>Id</th> <th>Health</th> <th>Body</th> <th>Effects</th> <th>Spawn</th></tr></thead><tbody>";
// keeps getting the next row until there are no more to get

while($row = mysql_fetch_array( $query )) {

 $mob_id = $row['mob_id'];
 $mob = $row['mob'];
 $body = $row['body'];
$mob_name = $row['mob_name'];
 $health = $row['health'];
 $level = $row['level'];

// Print out the contents of each row into a table
echo "<tr><td>";
echo "<img src='/testarea/include/mobs/$mob' />";
echo "</td><td>";
echo $mob_name;
echo "</td><td>";
echo $level;
echo "</td><td>";
echo $health;
echo "</td><td>";
echo 


"
<a onmouseover='popup($('#hidden-table').html(), 400);' href=''><img src='/testarea/include/mobs/dead/$body' /></a>
";

echo "

<div id='hidden-table' style='display:none;'>
<table border='0' cellpadding='0' cellspacing='0' class='center3'>
  <tr>
  <td width='14'><img src='images/info_tl.png'></td>
  <td style='background: url(images/info_tm.png)' align='center'></td>
  <td width='14'><img src='images/info_tr.png'></td>
  </tr>
  <tr>
  <td style='background: url(images/info_ml.png)'><h2>.</h2></td>
  <td style='background: url(images/info_mm.png)'>
";




$query2 = mysql_query("SELECT * FROM tbl_drop WHERE mob_name='$mob_name'") or die(mysql_error());

echo "<table border='0' cellpadding='1' cellspacing='1' width='250' id='2' class='tablesorter'><thead>";
 echo "<tr> <th> </th> <th>Item Name</th> <th>Qty</th></thead><tbody>";
// keeps getting the next row until there are no more to get

while($row = mysql_fetch_array( $query2 )) {

$id = $row['id'];
$item_img = $row['item_img'];
$qty = $row['qty'];
$item_name = $row['item_name'];


// Print out the contents of each row into a table
echo "<tr><td width='50'>";
echo "<img src='/testarea/item/$item_img' />";
echo "</td><td width='150'>";
echo $item_name;
echo "</td><td width='50'>";
echo $qty;
echo "</td></tr>";
}

echo "</tbody></table>";


echo "
  </td>
  <td style='background: url(images/info_mr.png)'><h2>.</h2></td>
  </tr>
  <tr>
  <td width='14'><img src='images/info_bl.png'></td>
  <td style='background: url(images/info_bm.png)' align='center'><h2>.</h2></td>
  <td width='14'><img src='images/info_br.png'></td>
  </tr>
  </table>
</div>"




;
echo "</td><td>";
echo "test";
echo "</td><td>";
echo "test";
echo "</td></tr>";
}

echo "</tbody></table>";

?>




  </td>
  <td style="background: url(images/box_mr.png)"><h2>.</h2></td>
  </tr>
  <tr>
  <td width='60'><img src="images/box_bl.png"></td>
  <td style="background: url(images/box_bm.png)" align="center"><h2>.</h2></td>
  <td width='25'><img src="images/box_br.png"></td>
  </tr>
  </table>

</html>

1 个答案:

答案 0 :(得分:0)

当您尝试引用jQuery选择器时,您无意中结束了onmouseover事件。出于不同原因使用单引号是原因。试试这个:

function ShowPop()
{
    popup($('#hidden-table').html(), 400);
}

<a onmouseover='ShowPop()' href=''><img ..... /></a> 
相关问题