mirror of
https://gitlab.com/andybalaam/htmlslides.git
synced 2025-06-12 06:25:09 +00:00
Stay scrolled to the right page when the window is resized
This commit is contained in:
parent
6e908e795b
commit
2fca806390
@ -77,6 +77,10 @@ function on_load() {
|
|||||||
current_slide = find_slide(slide_anchors, window.location.hash);
|
current_slide = find_slide(slide_anchors, window.location.hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function on_resize() {
|
||||||
|
return go_to_slide(current_slide);
|
||||||
|
}
|
||||||
|
|
||||||
function is_interactive_element(element) {
|
function is_interactive_element(element) {
|
||||||
let tag = element.tagName.toLowerCase();
|
let tag = element.tagName.toLowerCase();
|
||||||
return (tag === "a" || tag === "button" || tag === "input");
|
return (tag === "a" || tag === "button" || tag === "input");
|
||||||
@ -211,5 +215,6 @@ function fail(msg, obj) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
window.addEventListener("load", on_load);
|
window.addEventListener("load", on_load);
|
||||||
|
window.addEventListener("resize", on_resize);
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
Loading…
Reference in New Issue
Block a user