diff --git a/resources/public/js/main.js b/resources/public/js/main.js index 5800c97..c72d6df 100644 --- a/resources/public/js/main.js +++ b/resources/public/js/main.js @@ -3,4 +3,19 @@ $(function () { var page = $(e.target).val(); window.location = '/page/' + page; }); + + $(document).on('keydown', function(e) { + switch (e.keyCode) { + case 76: // l + case 39: // --> + var prevUrl = $('#prev-image').attr('href'); + if (prevUrl !== undefined) window.location = prevUrl; + break; + case 72: // h + case 37: // <-- + var nextUrl = $('#next-image').attr('href'); + if (nextUrl !== undefined) window.location = nextUrl; + break; + } + }); }); diff --git a/resources/templates/detail.html b/resources/templates/detail.html index 2cf8f57..7f5f9df 100644 --- a/resources/templates/detail.html +++ b/resources/templates/detail.html @@ -4,27 +4,28 @@