您的位置:首页 > Web前端 > JQuery

自学MVC(八):在jquery里让DIV随鼠标移动-2009年05月15日

2009-06-20 15:24 281 查看
<script language="javascript" type="text/javascript">
$(function() {
$("#upLower").mousemove(function() {
$("#toolTip").css({ top: event.clientY + 5, left: event.clientX + 10 });//event.clientY 鼠标所在的坐标的Y轴
});
})
</script>
<div id="toolTip" style="width:120px;"></div> //跟随鼠标移动的层
<li id="upLower"> //在其上触发onmousemove事件
</li>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: