我在mysql中有一个玩家及其信息的数据库。我在 dreamweaver 中创建了一个表格,显示所有玩家及其信息。我想显示与此表分开的玩家配置文件(存储在 mysql 中),并希望当鼠标悬停在表中的玩家上时,此信息会发生变化。这可能吗,我该怎么做?任何帮助或教程链接将受到极大的欢迎!我有我的页面的屏幕截图,但由于声誉而无法发布,如果有人想可视化我的想法,也许我可以发送给他们?
<div class="playerInfoContainer">
<table width="95%" border="0" cellpadding="3">
<caption>
Player Profile
</caption>
<tr>
<td><?php echo $row_Recordset1['PlayerProfile']; ?></td>
</tr>
</table>
</div>
</div>
<div class="squadListContainer">
<div class="DatabaseContainer">
<table width="95%" border="0" cellpadding="3">
<caption>
Bedlinog Veterans Squad
</caption>
<tr>
<th scope="col">Player Name</th>
<th scope="col">Position</th>
<th scope="col">Date of Birth</th>
<th scope="col">Points Tally</th>
<th scope="col">Man of the Matches</th>
</tr>
<?php do { ?>
<tr>
<td width="130"><?php echo $row_Recordset1['PlayerName']; ?></td>
<td width="100"><?php echo $row_Recordset1['Position']; ?></td>
<td width="100"><?php echo $row_Recordset1['DateOfBirth']; ?></td>
<td width="100"><?php echo $row_Recordset1['PointsTally']; ?></td>
<td width="100"><?php echo $row_Recordset1['MOM']; ?></td>
</tr>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
</table>
</div>
首先,将所有显示的鼠标悬停数据预先构建到单独的 XML/JSON 文件中。这样,当有人用光标发疯时,数据库就不会加载一次显示 15 个项目。
其次,使用 jquery 显示鼠标悬停事件,以使用单独的 HTML 文件填充页面上的div。
只要你的jquery是正确的,你的css技能达到了要求,细节就会根据需要改变,并在从一个"团队/小队"到下一个"团队/小队"的过程中保持正确的外观/感觉。