author | veltr |
Fri, 20 Sep 2013 17:34:07 +0200 | |
changeset 97 | 0444ad28e6ba |
parent 68 | 4def147b1604 |
permissions | -rw-r--r-- |
68
4def147b1604
Added a visualization of the contents of clusters + mousewheel support
veltr
parents:
diff
changeset
|
1 |
/*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net) |
4def147b1604
Added a visualization of the contents of clusters + mousewheel support
veltr
parents:
diff
changeset
|
2 |
* Licensed under the MIT License (LICENSE.txt). |
4def147b1604
Added a visualization of the contents of clusters + mousewheel support
veltr
parents:
diff
changeset
|
3 |
* |
4def147b1604
Added a visualization of the contents of clusters + mousewheel support
veltr
parents:
diff
changeset
|
4 |
* Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers. |
4def147b1604
Added a visualization of the contents of clusters + mousewheel support
veltr
parents:
diff
changeset
|
5 |
* Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix. |
4def147b1604
Added a visualization of the contents of clusters + mousewheel support
veltr
parents:
diff
changeset
|
6 |
* Thanks to: Seamus Leahy for adding deltaX and deltaY |
4def147b1604
Added a visualization of the contents of clusters + mousewheel support
veltr
parents:
diff
changeset
|
7 |
* |
4def147b1604
Added a visualization of the contents of clusters + mousewheel support
veltr
parents:
diff
changeset
|
8 |
* Version: 3.0.6 |
4def147b1604
Added a visualization of the contents of clusters + mousewheel support
veltr
parents:
diff
changeset
|
9 |
* |
4def147b1604
Added a visualization of the contents of clusters + mousewheel support
veltr
parents:
diff
changeset
|
10 |
* Requires: 1.2.2+ |
4def147b1604
Added a visualization of the contents of clusters + mousewheel support
veltr
parents:
diff
changeset
|
11 |
*/ |
4def147b1604
Added a visualization of the contents of clusters + mousewheel support
veltr
parents:
diff
changeset
|
12 |
(function(a){function d(b){var c=b||window.event,d=[].slice.call(arguments,1),e=0,f=!0,g=0,h=0;return b=a.event.fix(c),b.type="mousewheel",c.wheelDelta&&(e=c.wheelDelta/120),c.detail&&(e=-c.detail/3),h=e,c.axis!==undefined&&c.axis===c.HORIZONTAL_AXIS&&(h=0,g=-1*e),c.wheelDeltaY!==undefined&&(h=c.wheelDeltaY/120),c.wheelDeltaX!==undefined&&(g=-1*c.wheelDeltaX/120),d.unshift(b,e,g,h),(a.event.dispatch||a.event.handle).apply(this,d)}var b=["DOMMouseScroll","mousewheel"];if(a.event.fixHooks)for(var c=b.length;c;)a.event.fixHooks[b[--c]]=a.event.mouseHooks;a.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=b.length;a;)this.addEventListener(b[--a],d,!1);else this.onmousewheel=d},teardown:function(){if(this.removeEventListener)for(var a=b.length;a;)this.removeEventListener(b[--a],d,!1);else this.onmousewheel=null}},a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery) |