/* copyright (c) 2009 brandon aaron (http://brandonaaron.net) * dual licensed under the mit (http://www.opensource.org/licenses/mit-license.php) * and gpl (http://www.opensource.org/licenses/gpl-license.php) licenses. * thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers. * thanks to: mathias bank(http://www.mathias-bank.de) for a scope bug fix. * * version: 3.0.2 * * requires: 1.2.2+ */ (function(c){var a=["dommousescroll","mousewheel"];c.event.special.mousewheel={setup:function(){if(this.addeventlistener){for(var d=a.length;d;){this.addeventlistener(a[--d],b,false)}}else{this.onmousewheel=b}},teardown:function(){if(this.removeeventlistener){for(var d=a.length;d;){this.removeeventlistener(a[--d],b,false)}}else{this.onmousewheel=null}}};c.fn.extend({mousewheel:function(d){return d?this.bind("mousewheel",d):this.trigger("mousewheel")},unmousewheel:function(d){return this.unbind("mousewheel",d)}});function b(f){var d=[].slice.call(arguments,1),g=0,e=true;f=c.event.fix(f||window.event);f.type="mousewheel";if(f.wheeldelta){g=f.wheeldelta/120}if(f.detail){g=-f.detail/3}d.unshift(f,g);return c.event.handle.apply(this,d)}})(jquery);