Skip to content
Snippets Groups Projects
Verified Commit 5ec1bc5c authored by Jean-Baptiste Pasquier's avatar Jean-Baptiste Pasquier Committed by Gaëlle Morin
Browse files

fix: firefox scroll

parent 5428e5aa
No related branches found
No related tags found
1 merge request!230Release/i18n
document.addEventListener("DOMContentLoaded", () => {
window.scrollTo(0, 1);
let scrollTop = 1;
let fromTop = () => {
return window.pageYOffset || document.compatMode === "CSS1Compat" && document.documentElement.scrollTop || document.body.scrollTop || 0;
};
let isbody = setInterval(() => {
if (document.body) {
clearInterval(isbody);
scrollTop = fromTop();
window.scrollTo(0, scrollTop === 1 ? 0 : 1);
}
}, 15);
window.addEventListener("load", () => {
setTimeout(() => {
if (fromTop() < 20) {
window.scrollTo(0, scrollTop === 1 ? 0 : 1);
}
}, 0);
});
});
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment