mirror of
https://gitlab.com/andybalaam/htmlslides.git
synced 2025-06-09 09:31:34 +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);
|
||||
}
|
||||
|
||||
function on_resize() {
|
||||
return go_to_slide(current_slide);
|
||||
}
|
||||
|
||||
function is_interactive_element(element) {
|
||||
let tag = element.tagName.toLowerCase();
|
||||
return (tag === "a" || tag === "button" || tag === "input");
|
||||
@ -211,5 +215,6 @@ function fail(msg, obj) {
|
||||
}
|
||||
|
||||
window.addEventListener("load", on_load);
|
||||
window.addEventListener("resize", on_resize);
|
||||
|
||||
}());
|
||||
|
Loading…
Reference in New Issue
Block a user