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;
|
var target = document.getElementById("previous_photo").href;
|
||||||
if (target) {
|
if (target) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
document.location.href = target;
|
document.location.href = target + '#photo_frame';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (event.keyCode == 39) {
|
else if (event.keyCode == 39) {
|
||||||
var target = document.getElementById("next_photo").href;
|
var target = document.getElementById("next_photo").href;
|
||||||
if (target) {
|
if (target) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
document.location.href = target;
|
document.location.href = target + '#photo_frame';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, false);
|
}, false);
|
||||||
@ -53,13 +53,13 @@ function enableTouchNavigation() {
|
|||||||
var target = document.getElementById("previous_photo").href;
|
var target = document.getElementById("previous_photo").href;
|
||||||
if (target) {
|
if (target) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
document.location.href = target;
|
document.location.href = target + '#photo_frame';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
var target = document.getElementById("next_photo").href;
|
var target = document.getElementById("next_photo").href;
|
||||||
if (target) {
|
if (target) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
document.location.href = target;
|
document.location.href = target + '#photo_frame';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user