front_idill/lib/jquery.mousewheel-2.0.0.min.js
author bastiena
Mon, 24 Sep 2012 12:55:00 +0200
changeset 120 784382def9ee
parent 52 277c94533395
permissions -rw-r--r--
Étiquette V00.15 ajoutée à la révision 18784c67a338
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
52
277c94533395 Front IDILL :
bastiena
parents:
diff changeset
     1
/* Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net)
277c94533395 Front IDILL :
bastiena
parents:
diff changeset
     2
 * Licensed under the MIT License (LICENSE.txt).
277c94533395 Front IDILL :
bastiena
parents:
diff changeset
     3
 *
277c94533395 Front IDILL :
bastiena
parents:
diff changeset
     4
 * Thanks to: Andrew Cobby (@andrewcobby http://github.com/cobbweb)
277c94533395 Front IDILL :
bastiena
parents:
diff changeset
     5
 *              - Refactored for jQuery 1.7+ only
277c94533395 Front IDILL :
bastiena
parents:
diff changeset
     6
 *              - Use MozMousePixelScroll for new Gecko browsers
277c94533395 Front IDILL :
bastiena
parents:
diff changeset
     7
 * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
277c94533395 Front IDILL :
bastiena
parents:
diff changeset
     8
 * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
277c94533395 Front IDILL :
bastiena
parents:
diff changeset
     9
 * Thanks to: Seamus Leahy for adding deltaX and deltaY
277c94533395 Front IDILL :
bastiena
parents:
diff changeset
    10
 *
277c94533395 Front IDILL :
bastiena
parents:
diff changeset
    11
 * Version: 2.0.0
277c94533395 Front IDILL :
bastiena
parents:
diff changeset
    12
 *
277c94533395 Front IDILL :
bastiena
parents:
diff changeset
    13
 * Requires jQuery: 1.7+
277c94533395 Front IDILL :
bastiena
parents:
diff changeset
    14
 */(function(a,b){function e(d){var f=d||window.event,g=[].slice.call(arguments,1),h=0,i=0,j=0;return d=a.event.fix(f),d.type="mousewheel",f.wheelDelta&&(h=f.wheelDelta/120),f.detail&&(f.type==c[2]?(this.removeEventListener(c[0],e,!1),h=-f.detail/42):h=-f.detail/3),j=h,f.axis!==b&&f.axis===f.HORIZONTAL_AXIS&&(j=0,i=-1*h),f.wheelDeltaY!==b&&(j=f.wheelDeltaY/120),f.wheelDeltaX!==b&&(i=-1*f.wheelDeltaX/120),g.unshift(d,h,i,j),(a.event.dispatch||a.event.handle).apply(this,g)}var c=["DOMMouseScroll","mousewheel","MozMousePixelScroll"];if(a.event.fixHooks)for(var d=c.length;d;)a.event.fixHooks[c[--d]]=a.event.mouseHooks;a.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=c.length;a;)this.addEventListener(c[--a],e,!1);else this.onmousewheel=e},teardown:function(){if(this.removeEventListener)for(var a=c.length;a;)this.removeEventListener(c[--a],e,!1);else this.onmousewheel=null}}})(jQuery);