<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 && 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></script>
div1
div2