KnightRobby / hoverzoom

Automatically exported from code.google.com/p/hoverzoom
0 stars 1 forks source link

Too much sensitivity when scrolling through multiple images #775

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Problem description: When using hoverzoom on galleries on reddit the 
sensitivity is too much when scrolling through them

URL (web address) where the problem occurs:
http://www.reddit.com/r/pics

Hover Zoom version:  5.3
Google Chrome version: 37.0.2062.120
Operating system: OS X 10.9.4

Code suggestion:

        var delta = 0;
        function documentOnMouseWheel(event) {
          if (imgFullSize) {
            var link = hz.currentLink, data = link.data();
            if (data.hoverZoomGallerySrc) {
              event.preventDefault();
              delta += event.originalEvent.wheelDeltaY;
              if (Math.abs(delta) > 30) {
                if (delta > 0) {
                  rotateGalleryImg(-1);
                } else {
                  rotateGalleryImg(1);
                }
                delta = 0;
              }
            }
          }
        }

Original issue reported on code.google.com by baldur.h...@gmail.com on 13 Sep 2014 at 11:02