diff options
author | Hakim El Hattab | 2013-06-16 19:55:50 -0400 |
---|---|---|
committer | Hakim El Hattab | 2013-06-16 19:55:58 -0400 |
commit | b0b6c756295cefb66b93a5f2d807eab2e43eb8a4 (patch) | |
tree | e811e2d9ac8dc1dd42b03dcd9631b5ed6ab89f58 /js/reveal.js | |
parent | b6e3568f52de818655a429da882cab1dbc0d5b1c (diff) |
mouse wheel tweaks (closes #454)
Diffstat (limited to 'js/reveal.js')
-rw-r--r-- | js/reveal.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/js/reveal.js b/js/reveal.js index e7788c2..8015244 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -126,7 +126,7 @@ var Reveal = (function(){ 'transform' in document.body.style, // Throttles mouse wheel navigation - mouseWheelTimeout = 0, + lastMouseWheelStep = 0, // An interval used to automatically move on to the next slide autoSlideTimeout = 0, @@ -2335,9 +2335,10 @@ var Reveal = (function(){ */ function onDocumentMouseScroll( event ) { - clearTimeout( mouseWheelTimeout ); + if( Date.now() - lastMouseWheelStep > 600 ) { + + lastMouseWheelStep = Date.now(); - mouseWheelTimeout = setTimeout( function() { var delta = event.detail || -event.wheelDelta; if( delta > 0 ) { navigateNext(); @@ -2345,7 +2346,8 @@ var Reveal = (function(){ else { navigatePrev(); } - }, 100 ); + + } } |