复制代码代码如下: <script><BR>(function($){<BR> $.fn.moveStopEvent = function(callback){<BR> return this.each(function() {<BR> var x = 0,<BR> y = 0,<BR> x1 = 0,<BR> y1 = 0,<BR> isRun = false,<BR> si,<BR> self = this; <P> var sif = function(){<BR> si = setInterval(function(){<BR> if(x == x1 && y ==y1){<BR> clearInterval(si);<BR> isRun = false;<BR> 回调 && 回调.call(self);<BR> }<BR> x = x1;<BR> y = y1;<BR> }, 500);<BR> } <P> $(this).mousemove(function(e){<BR> x1 = e.pageX;<BR> y1 = e.pageY;<BR> !isRun && sif(), isRun = true;<BR> }).mouseout(function(){<BR> clearInterval(si);<BR> isRun = false;<BR> });<BR> });<BR> }<BR>})(jQuery); <P>$(function(){<BR> $("#div1,#div2").moveStopEvent(function(){<BR> alert($(this).attr("id"));<BR> }<BR> );<BR>});<BR>div1div2< /div>