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

 <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="120px;"></div> //跟随鼠标移动的层
<li  id="upLower"> //在其上触发onmousemove事件
</li>
原文地址:https://www.cnblogs.com/wangergo/p/1507364.html