Created
June 6, 2017 08:44
-
-
Save anonymous/6ae8eb51c3d8038523cb076795d55710 to your computer and use it in GitHub Desktop.
Animated Knots key handling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function checkArrowKeys(e) { | |
var evt = e ? e : event; | |
var mykey = evt.keyCode; | |
if ((mykey == 37) && (prevKnot > 1)) { | |
showButtons(ButtonFadeDelay); | |
elemQ = document.getElementById('Prelim'); // Get Identity | |
elemQ.style.zIndex = -2; // Hide Labelled Image If Showing | |
nextImage(prevKnot, prevKnot - 1); // Previous Image | |
prevKnot--; // Decrease Count | |
reset(); | |
e.preventDefault(); // inserted e.preventDefault() here | |
} | |
// Right Arrow Key (Up) | |
if ((mykey == 39) && (prevKnot < MaxImages)) { | |
showButtons(ButtonFadeDelay); | |
elemQ = document.getElementById('Prelim'); // Get Identity | |
elemQ.style.zIndex = -2; // Hide Labelled Image If Showing | |
nextImage(prevKnot, prevKnot + 1); // Previous Image | |
prevKnot++; // Decrease Count | |
reset(); | |
e.preventDefault(); // inserted e.preventDefault() here | |
} | |
// Removed e.preventDefault() from here | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment