Skip to content
Snippets Groups Projects
Commit 17854e89 authored by Hakim El Hattab's avatar Hakim El Hattab
Browse files

Merge pull request #13 from naugtur/master

Mouse scroll handling
parents 896e0b70 2ae803ef
No related branches found
No related tags found
No related merge requests found
......@@ -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,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment