JS photo nav: scroll to #photo_frame automatically.

This commit is contained in:
Aaron van Geffen 2016-11-24 16:13:49 +01:00
parent fc02c9b93a
commit 9f92ed6d7a

View File

@ -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';
}
}
}