Stay scrolled to the right page when the window is resized

This commit is contained in:
Andy Balaam 2020-07-24 14:27:35 +01:00
parent 6e908e795b
commit 2fca806390

View File

@ -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);
}());