Created
March 4, 2011 05:00
-
-
Save narrowdesign/854198 to your computer and use it in GitHub Desktop.
Arrow Key Events
This file contains 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
$(document).keydown(function(e){ | |
if (e.keyCode == 37) { | |
var previous = self.currentX; | |
self.currentX = self.limitXBounds(self.previousPageX(self.currentX)); | |
if (self.currentX !== previous) { | |
self.update(); | |
} | |
return false; | |
}else if (e.keyCode == 39) { | |
var previous = self.currentX; | |
self.currentX = self.limitXBounds(self.nextPageX(self.currentX)); | |
if (self.currentX !== previous) { | |
self.update(); | |
} | |
return false; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment