From 9f92ed6d7a17c81e2f5c321abd004e4a583cb139 Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Thu, 24 Nov 2016 16:13:49 +0100 Subject: [PATCH] JS photo nav: scroll to #photo_frame automatically. --- public/js/photonav.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/js/photonav.js b/public/js/photonav.js index 44e4fd3..e9019f2 100644 --- a/public/js/photonav.js +++ b/public/js/photonav.js @@ -4,14 +4,14 @@ function enableKeyDownNavigation() { var target = document.getElementById("previous_photo").href; if (target) { event.preventDefault(); - document.location.href = target; + document.location.href = target + '#photo_frame'; } } else if (event.keyCode == 39) { var target = document.getElementById("next_photo").href; if (target) { event.preventDefault(); - document.location.href = target; + document.location.href = target + '#photo_frame'; } } }, false); @@ -53,13 +53,13 @@ function enableTouchNavigation() { var target = document.getElementById("previous_photo").href; if (target) { event.preventDefault(); - document.location.href = target; + document.location.href = target + '#photo_frame'; } } else { var target = document.getElementById("next_photo").href; if (target) { event.preventDefault(); - document.location.href = target; + document.location.href = target + '#photo_frame'; } } }