fancyapps/fancyBox — Issue #165: Mousewheel handler misbehaves in Chrome
Author: hardyharz3n
Created: 2012-02-26 22:19:25+00:00
State: open

The problem seems to be this line

F[delta > 0 ? 'prev' : 'next']();

Scrolling up at the very beginning of a (non-looped) gallery yields two handler calls with delta values 1 and 0, respectively. Chrome apparently resolves the ternary differently (than FF, which I only tested with otherwise), calling 'next' for the value of 0. Apparently, Chrome thinks the opposite of greater than is lower than _or equal_.

A simple

if (delta == 0) return false;

or similar beforehand restores normal behavior.

Take care.