複製程式碼程式碼如下: </腳本><BR><腳本><BR>(function($){<BR> $.fn.moveStopEvent = 函數(回呼){<BR> return this.each(function() {<BR> var x = 0 ,<BR> y = 0,<BR> x1 = 0,<BR> y1 = 0,<BR> isRun = false,<. 🎜> <BR> var sif = function(){<BR> si = setInterval(function(){ );<P> isRun = false;<BR> 回呼&& 回調.call(self);<BR> }< y = y1;<BR> }, 500);<BR> }<BR> <BR> $(this).mousemove(function(e){<BR> x1 = e.pageX;<BR> y1 = e.pageY;<BR> ; }).mouseout(function(){<BR> clearInterval(si); isRun = false;<P> });<BR> });<BR> });<BR> });<BR> });<BR>} 🎜> <BR>$(function(){<BR> $("#div1,#div2").moveStopEvent(function(){<BR> alert($(this).attr("id"));<BR> }<BR> );});<P>div1 div2