Skip to content

Instantly share code, notes, and snippets.

@brettbuddin
Forked from narrowdesign/ArrowKeyEvents
Created March 4, 2011 05:07
Show Gist options
  • Save brettbuddin/854206 to your computer and use it in GitHub Desktop.
Save brettbuddin/854206 to your computer and use it in GitHub Desktop.
$(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