/*! 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(b){function d(a){var f=[].slice.call(arguments,1),e=0;a=b.event.fix(a||window.event);a.type="mousewheel";if(a.wheeldelta)e=a.wheeldelta/120;if(a.detail)e=-a.detail/3;f.unshift(a,e);return b.event.handle.apply(this,f)}var c=["dommousescroll","mousewheel"];b.event.special.mousewheel={setup:function(){if(this.addeventlistener)for(var a=c.length;a;)this.addeventlistener(c[--a],d,false);else this.onmousewheel=d},teardown:function(){if(this.removeeventlistener)for(var a=c.length;a;)this.removeeventlistener(c[--a], d,false);else this.onmousewheel=null}};b.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jquery);