复主代码 代码如下: <br><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> 콜백 && callback.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>