/** * @author trixta * @version 1.2 */ (function(a){function i(){this===b.elem&&(b.pos=[-260,-260],b.elem=!1,c=3)}var b={pos:[-260,-260]},c=3,d=document,e=d.documentElement,f=d.body,g,h;a.event.special.mwheelIntent={setup:function(){var b=a(this).bind("mousewheel",a.event.special.mwheelIntent.handler);return this!==d&&this!==e&&this!==f&&b.bind("mouseleave",i),b=null,!0},teardown:function(){return a(this).unbind("mousewheel",a.event.special.mwheelIntent.handler).unbind("mouseleave",i),!0},handler:function(d,e){var f=[d.clientX,d.clientY];if(this===b.elem||Math.abs(b.pos[0]-f[0])>c||Math.abs(b.pos[1]-f[1])>c)return b.elem=this,b.pos=f,c=250,clearTimeout(h),h=setTimeout(function(){c=10},200),clearTimeout(g),g=setTimeout(function(){c=3},1500),d=a.extend({},d,{type:"mwheelIntent"}),a.event.handle.apply(this,arguments)}},a.fn.extend({mwheelIntent:function(a){return a?this.bind("mwheelIntent",a):this.trigger("mwheelIntent")},unmwheelIntent:function(a){return this.unbind("mwheelIntent",a)}}),a(function(){f=d.body,a(d).bind("mwheelIntent.mwheelIntentDefault",a.noop)})})(jQuery)