I have tried both onload="window.scrollTo(0,0);" and onload="$('html,body').scrollTop(0);" but after the page loads it still stays at the current position, I am using frames. I have tried some of the other suggestions but still no luck could someone please point me in the right direction. Do I need to add a scroll to top to my frame? I need the page that contains the frame to reload when the frame inside reloads, hope it makes sense.
<body onload="window.scrollTo(0,0); $('html,body').scrollTop(0);">
<iframe id="my-iframe-tag" scrolling="no">
</iframe>
</body>
hi all this seems to have done the trick onload="parent.scrollTo(0,0);" after some searching this helped Scroll to top of parent frame on iframe change? thanks though
Using the scrollTop method on DOM ready:
$(document).ready(function(){
$(this).scrollTop(0);
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With