【发布时间】:2012-06-15 17:54:55
【问题描述】:
大家好,我正在尝试使用鼠标悬停将 mysql 行填充为工具提示,但是我只是将第一行作为工具提示填充,您知道我缺少什么非常感谢您的帮助这里是我的代码,它只首先显示行作为工具提示框。
$(function () {
$(".test").hover(
function () {
var toolTipHtml = $("#ToolTipDiv_ +'$id'").clone();
$(this).append(toolTipHtml);
toolTipHtml.show("slow");
},
function () {
var toolTipHtml = $(this).find(".tooltip");
toolTipHtml.hide();
toolTipHtml.remove();
}
);
});
echo "<table>";
while($row = mysql_fetch_array($result))
{
$id = $row['id_out_org'];
echo "<tr>";
echo "<td>" .$row['KG']."</td>";
echo "<td class='test'>" .$row['B']."</td>";
echo "<td >" .$row['B']."</td>";
echo "<td class='test'>";
echo "<div id = 'ToolTipDiv_"/$id/"' class='tooltip' style='background-color: White; display: none; width: 20%;'>";
echo "Total: $ "; echo $totalp = $total + $fuel;
echo "</div>";
"</td>";
echo "</tr>";
}
echo "</table>";
【问题讨论】:
-
使用
echo ($row['A']-$row['B']);而不是echo $total = $row['A'] - $row['B'];
标签: php jquery mysql html-table