Skip to content

Instantly share code, notes, and snippets.

@marianposaceanu
Created June 1, 2012 10:10
Show Gist options
  • Save marianposaceanu/2850953 to your computer and use it in GitHub Desktop.
Save marianposaceanu/2850953 to your computer and use it in GitHub Desktop.
leftie.js
//
// Add this to plugin.js after the onload event
//
$.each(["keydown", "keyup", "keypress"], function(id,key_event_name) {
$(document).on(key_event_name, function(e) {
(e.keyCode == 37) ? window.location.href = $("a[rel='prev']").attr('href') : null;
(e.keyCode == 39) ? window.location.href = $("a[rel='next']").attr('href') : null;
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment