Is there a Javascript event that I can hook into that fires when the page is refreshed, and Safari 'jumps' back to the scroll position you were at?
It's very frustrating, as the scroll
event only fires on user/touch-induced scrolls, so will not fire in this case. I need to specifically find a way to bind to that event, as DOMContentLoaded
, for example, fires even before that, and the window's load
event would fire too late, as that will wait for all content to load.
Reason for this is that I am checking if an element is in view (using getBoundingClientRect
).
Am I missing something here? As I'm not using jQuery, but vanilla JS, I have no document.ready()
to try (though judging by the source code of it, I doubt it would work).