Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prevent page from scrolling to an iframe on load?

I have an iframe in my page and when I load the page, the page scrolls to the start on the iframe which is about 200px from the top of the page. If I change the iframe to a div then the page loading is as normal, meaning the page is scrolled to the top. So it is something about the iframe that is causing this.

Does anyone know how to prevent this from happening?

like image 316
tim peterson Avatar asked Nov 21 '25 12:11

tim peterson


1 Answers

Sorry, this was a dumb question. I just set the style property to display:none; and that solved it.

like image 121
tim peterson Avatar answered Nov 24 '25 21:11

tim peterson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!