<!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>
<style type="text/css">
body, div { margin: 0; paading: 0; font-size: 12px; }
ul, li { margin: 0; padding: 0; list-style: none; }
.clear { clear: both; width: 1px; height: 0; line-heght: 0; font-size: 1px; }
.box { position: relative; width: 960px; margin: 0 auto; padding-top: 15px; }
.drag { float: left; width: 600px; margin: 0 6px; padding: 5px; border: 1px solid #ccc; }
.drag ul { width: 400px; }
.drag li { margin-top: 10px; line-height: 28px; }
.drag li img { width: 250px; height: 120px; }
.msg { clear: both; width: 300px; min-height: 200px; margin: 15px; padding: 10px; border: 1px solid #f00; }
#mess { overflow: hidden; position: absoute; display: none; width: 300px; height: 150px; padding: 2px 5px; border: 1px solid #f00; background: #ccc; }
</style>
<script type="text/javascript" src="jquery-1.6.1.min.js"></script>
<script type="text/javascript">
//mousemove 的用法,
$(document).ready(function() {
$(".drag li").each(function() {
$(this).hover(function(event) {
var x = event.pageX - 480;
var y = event.pageY - 20;
$("#mess").css({display: "block", left: x + "px", top: y + "px"});
$("#mess").html($(this).html());
}, function() {
$("#mess").hide();
});
$(this).mousemove(function(event) {
var x = event.pageX - 480;
var y = event.pageY - 20;
$("#mess").css({ position: "absolute", display: "block", left: x + "px", top: y + "px"});
$("#mess").html($(this).html());
});
});
});
</script>
</head>
<body>
<div class="box" >
<div class="drag drag1">
<ul>
<li>如果不显示提示文字证明你的RP确实有问题</li>
<li>真的不显示提示文字?我的RP确实有问题?</li>
<li>不可能不显示提示文字?我的RP不可能有问题?</li>
<li>显示提示文字啦,我的RP没有问题</li>
<li><img src="images/p1.jpg"/></li>
<li><img src="images/2.jpg"/></li>
<li><img src="images/3.jpg"/></li>
</ul>
<div id="mess"></div>
</div>
<div class="clear"></div>
</div>
</body>
</html>
在MouseOver里加一个判断,试试,当你的鼠标在被提示对象上或者鼠标在提示框上时,就显示提示框,如果这这两个条件都不满足就隐藏提示框 。
解决了。。呵呵谢谢了啊
同上啊。