日期:2014-05-17 浏览次数:20866 次
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function () { $("#imgLeave").mousemove(function (e) { $("#divDetails").css("top", e.pageY).css("left", e.pageX).show("slow"); }); $("#imgLeave").mouseleave(function () { $("#divDetails").hide(); }); $("#divDetails").mouseleave(function () { $("#divDetails").hide(); }); }) </script> </head> <body> <img src="images/1.jpg" width="160" height="120" id="imgLeave"/> <div id="divDetails" style="display: none; position: absolute; border-color: Green; border-width: 1px; border-style: solid; background-color: Yellow;"> <p> 图片名称:扣扣秀</p> <p> 所属人:无相</p> </div> </body> </html>
------解决方案--------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script src="js/jquery-1.4.2.min.js"></script>
<script>
$(function(){
$("#touxiang").hover(function(){
$("#ttt").show();
},function(){$("#ttt").hide(