自学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> 本文版权属于王传炜所有,首发http://www.cnblogs.com/,转载请注明出处。