Permalink
Browse files

Fixing mousewheel event for Chrome

  • Loading branch information...
1 parent 45b9b12 commit d99c88080d40df89b415be72c2f58e106bc172bb @cneves committed Mar 30, 2012
@@ -332,13 +332,12 @@ $.fn.viewportImage = function(options) {
* Handle Zoom by mousewheel (IE)
*/
- dragdiv.bind("mousewheel", function(e){
+ dragdiv.bind("mousewheel", function(e){
// Respond to mouse wheel in IE. (It returns up/dn motion in multiples of 120)
- if (e.wheelDelta >= 120)
+ if (e.originalEvent.wheelDeltaY > 0)
_this.doZoom(1, true);
- else if (e.wheelDelta <= -120)
+ else if (e.originalEvent.wheelDeltaY < 0)
_this.doZoom(-1, true);
-
e.preventDefault();
})
@@ -358,6 +357,7 @@ $.fn.viewportImage = function(options) {
}, false);
}
+
/**
* Handle panning by mouse drag
*/

0 comments on commit d99c880

Please sign in to comment.