forked from Public/pics
JS photo nav: scroll to #photo_frame automatically.
This commit is contained in:
parent
fc02c9b93a
commit
9f92ed6d7a
@ -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';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user