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

我怕爱的太早我们不能终老 提交于 2019-12-13 02:25:54

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/9936259/how-to-prevent-page-from-scrolling-to-an-iframe-on-load

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!