I have two buttons:
$('#prev').click(function() {
// some code
});
$('#next').click(function() {
// some other code
});
what I now want to do is adding a .keypress() handler to the site which triggers on arrow-left the #prev click and for arrow-right it triggers #next. Problem is how can I add this handler?
keyupevent (api.jquery.com/keyup). Make sure you attach to the document or something that will actually have focus. Otherwise your key events won't be fired as you expect.