MediaWiki:Common.js: Difference between revisions

Try another event listener
mNo edit summary
(Try another event listener)
Line 576: Line 576:
// Reset sticky header positions once the page is fully loaded.
// Reset sticky header positions once the page is fully loaded.
// Without this, headers may have an incorrect offset
// Without this, headers may have an incorrect offset
window.addEventListener('load', setStickyHeaderTop);
document.addEventListener('readystatechange', function(event) {
if (document.readyState === 'complete') {
setStickyHeaderTop();
}
});
}
}
});
});