Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
$(document).keydown(function(e){
// Ignore the keypress if any meta keys were pressed along with the arrows
if(e.metaKey || e.ctrlKey || e.altKey || e.shiftKey) return;
// Left arrow
if(e.keyCode == 37) {
// Find a rel="prev" link on the page
if($("a[rel='prev']").length > 0){
// Highlight it briefly
$("a[rel='prev']").addClass('hover');
// Navigate to the page
window.location.href = $("a[rel='prev']").attr('href');
}
return false;
}
// Right arrow
if(e.keyCode == 39) {
// Find a rel="next" link on the page
if($("a[rel='next']").length > 0){
// Highlight it briefly
$("a[rel='next']").addClass('hover');
// Navigate to the page
window.location.href = $("a[rel='next']").attr('href');
}
return false;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.