CSS-NibblePoker/htdocs/js/anchor-fix.js
2024-11-20 22:53:18 +01:00

11 lines
357 B
JavaScript

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