CSS-NibblePoker/htdocs/js/anchor-fix.js

11 lines
357 B
JavaScript
Raw Normal View History

// This script is required due to Chromium's dogshit and random ability to jump to anchors when reloading pages.
document.addEventListener("DOMContentLoaded", function () {
if (window.location.hash) {
const eAnchor = document.querySelector(window.location.hash);
if (eAnchor) {
eAnchor.scrollIntoView();
}
}
});