File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change 3
3
## 3.1.7-pre
4
4
5
5
* Better handle the ` deltaMode ` values 1 (lines) and 2 (pages)
6
+ * Attempt to better handle older browsers that use a wheelDelta based on 120
6
7
7
8
## 3.1.6
8
9
Original file line number Diff line number Diff line change 139
139
lowestDelta = absDelta ;
140
140
}
141
141
142
+ // Assuming that if the lowestDelta is 120, then that the browser
143
+ // is treating this as an older mouse wheel event.
144
+ // We'll divide it by 40 to try and get a more usable deltaFactor.
145
+ if ( lowestDelta === 120 ) {
146
+ // Divide all the things by 40!
147
+ delta /= 40 ;
148
+ deltaX /= 40 ;
149
+ deltaY /= 40 ;
150
+ lowestDelta /= 40 ;
151
+ }
152
+
142
153
// Get a whole, normalized value for the deltas
143
154
delta = Math [ delta >= 1 ? 'floor' : 'ceil' ] ( delta / lowestDelta ) ;
144
155
deltaX = Math [ deltaX >= 1 ? 'floor' : 'ceil' ] ( deltaX / lowestDelta ) ;
You can’t perform that action at this time.
0 commit comments