日期:2014-05-16 浏览次数:20481 次
<html> <head> <script language="javascript" type="text/javascript"> function showUserCard(name){ var taget_obj = document.getElementById(name); taget_obj.style.display="block"; } function hideUserCard(name){ var taget_obj = document.getElementById(name); taget_obj.style.display="none"; } </script> </head> <body> <div> <ul> <li class="center"><a><img onmouseover="showUserCard('fengjssy');" onmouseout="hideUserCard('fengjssy');" src="http://avatar.profile.csdn.net/8/9/1/2_fengjssy.jpg"></a></li> </ul></div> <div id="fengjssy" style="border-style: none; border-width: 0px; width: 357px; height: 194px; position: absolute; text-align: left; left: 150px; top: 10px; display:none;"> <img src="http://avatar.profile.csdn.net/8/9/1/2_fengjssy.jpg"> 其他内容 </div> </body> </html>
------解决方案--------------------
我胡乱写了个简单的例子,你看看吧。。。记得加上jquery.js再运行噢。。。
<html> <head> <title>绝对定位</title> <style> #msg { position: absolute; width:200px; height:150px; border:3px solid blue; padding: 5px 5px 5px 5px; display:none; color:red; background-color:white; } body { padding-left:100px; padding-top:100px; } td { width:80px; height:80px; } </style> <script src="jquery-1.2.6.pack.js"></script> </head> <body> <div> <table border="1"> <tbody> <tr> <td>Im's a TD11111</td> <td>Im's a TD22222</td> <td>Im's a TD33333</td> <td>Im's a TD44444</td> <td>Im's a TD55555</td> <td>Im's a TD66666</td> </tr> <tr> <td>Im's a TD77777</td> <td>Im's a TD88888</td> <td>Im's a TD99999</td> <td>Im's a TD00000</td> <td>Im's a TD12312</td> <td>Im's a TD45645</td> </tr> <tr> <td>Im's a TD78989</td> <td>Im's a TD54743</td> <td>Im's a TD24674</td> <td>Im's a TD34579</td> <td>Im's a TD23473</td> <td>Im's a TDsfhu7</td> </tr> <tr> <td>Im's a TD!</td> <td>Im's a TD!</td> <td>Im's a TD!</td> <td>Im's a TD!</td> <td>Im's a TD!</td>