/*! Copyright (c) 2013 Brandon Aaron (http://brandon.aaron.sh) * Licensed under the MIT License (LICENSE.txt). * * Version: 3.1.6 * * Requires: jQuery 1.2.2+ */ !function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e:e(jQuery)}(function(e){var t,n,o=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],l="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(e.event.fixHooks)for(var s=o.length;s;)e.event.fixHooks[o[--s]]=e.event.mouseHooks;function a(o){var l,s=o||window.event,a=i.call(arguments,1),u=0,r=0,d=0;if((o=e.event.fix(s)).type="mousewheel","detail"in s&&(d=-1*s.detail),"wheelDelta"in s&&(d=s.wheelDelta),"wheelDeltaY"in s&&(d=s.wheelDeltaY),"wheelDeltaX"in s&&(r=-1*s.wheelDeltaX),"axis"in s&&s.axis===s.HORIZONTAL_AXIS&&(r=-1*d,d=0),u=0===d?r:d,"deltaY"in s&&(u=d=-1*s.deltaY),"deltaX"in s&&(r=s.deltaX,0===d&&(u=-1*r)),0!==d||0!==r)return l=Math.max(Math.abs(d),Math.abs(r)),(!n||l=1?"floor":"ceil"](u/n),r=Math[r>=1?"floor":"ceil"](r/n),d=Math[d>=1?"floor":"ceil"](d/n),o.deltaX=r,o.deltaY=d,o.deltaFactor=n,a.unshift(o,u,r,d),t&&clearTimeout(t),t=setTimeout(h,200),(e.event.dispatch||e.event.handle).apply(this,a)}function h(){n=null}e.event.special.mousewheel={version:"3.1.6",setup:function(){if(this.addEventListener)for(var e=l.length;e;)this.addEventListener(l[--e],a,!1);else this.onmousewheel=a},teardown:function(){if(this.removeEventListener)for(var e=l.length;e;)this.removeEventListener(l[--e],a,!1);else this.onmousewheel=null}},e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})});