diff --git a/js/reveal.js b/js/reveal.js index 30add0201a199144cd2f1bb332a813bb662d4e13..fe66dab874bd123d378bce6a9d98c2d5cb0416a9 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -133,6 +133,11 @@ var Reveal = (function(){ // Add some 3D magic to our anchors linkify(); } + + //bind scrolling + if(window.addEventListener){ + document.addEventListener('DOMMouseScroll', scrollStep, false); + } // Read the initial hash readURL(); @@ -622,6 +627,26 @@ var Reveal = (function(){ } } + var stepT=0; + function scrollStep(e){ + clearTimeout(stepT); + stepT=setTimeout(function(){ + if(e.detail>0){ + if(availableRoutes().down){ + navigateDown() + }else{ + navigateRight() + } + }else{ + if(availableRoutes().up){ + navigateUp() + }else{ + navigateLeft() + } + } + },200); + } + // Expose some methods publicly return { initialize: initialize,