滚动到iframe上的父框架顶部更改? [英] Scroll to top of parent frame on iframe change?

查看:107
本文介绍了滚动到iframe上的父框架顶部更改?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当用户浏览iframe时,是否可以滚动(0,0)到父页面顶部?例如,我们有一个iframe是整个页面的高度,带有搜索结果。当您单击iframe中的下一页按钮时,焦点将保留在页面底部。

Is it possible to scroll(0,0) to the top of the parent page when the user browses in an iframe? For example, we have an iframe that is the entire height of the page with search results. When you click the next page button in the iframe, the focus stays at the bottom of the page.

我甚至不确定是否可以检测到这一点。 iframe src值实际上没有改变。

I'm not even sure if it's possible to detect this. The iframe src value doesn't actually change.

P.S。我不知道为什么这个网站必须使用iframe,但IE6是标准的浏览器,所以我没有提问。

P.S. I don't know why this site must use an iframe, but IE6 is the standard browser so I didn't ask questions.

推荐答案

p>实际上,在iframe中导航时,onload事件确实会起作用。

Actually, the onload event does appear to work when navigating within an iframe.

<iframe src="http://mysite.com" height="2392px" width="100%" name="searchFrame" onload="scroll(0,0);"></iframe>

这篇关于滚动到iframe上的父框架顶部更改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆