我的页面跳转到时候我嵌入这个GDrive的iframe中,一旦你点击了iframe顶部:页面跳转到顶部点击iframe中时
<iframe height="400px" frameborder="0" width="600px" src="https://docs.google.com/document/d/1u9NFjTPBd-9mucQUPvkqLP84iV6uaEcJNF5vQdHmYh8/edit?usp=sharing&rm=embedded"></iframe>
的jsfiddle:https://jsfiddle.net/0qpe53os/
问题:为什么它这样做,我如何防止它这样做?
我试图preventDefault
没有任何运气。提前感谢您的帮助。
Mybe这可以帮助你http://stackoverflow.com/questions/26017978/iframe-causes-parent-elements-to-scroll-up-on-google-chrome-when-url-contains-fr – elTomato
请看这里:http://stackoverflow.com/questions/26017978/iframe-causes-parent-elements-to-scroll-up-on-google-chrome-when-url-contains-fr – leodido