使用弹出窗口时出现IE7问题 [英] IE7 problem when using popups

查看:49
本文介绍了使用弹出窗口时出现IE7问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿大家,我现在正在开发一个大约3年前启动的php项目(意思是,它已经非常大了。)。


它使用得很好很多木偶似乎在所有浏览器中运行良好...或者习惯于IE 7出现。


问题是,如果我有一个生成弹出窗口的链接但是还重新定位单击链接的页面,主页面将在开始加载时出现在弹出窗口的顶部(这不会出现在IE 7以外的任何其他浏览器中)。如果页面有onload事件将焦点设置在页面的某个位置,就会发生这种情况。


我将提供一个过于简化的示例,在FF,IE 6和IE 7中试用它看看我的意思:


popup.html的内容:

< html>

< head>

< script language =''javascript''>

window.onload = function(){window.document.getElementById(''inputThing'')。focus() ; };

< / script>

< / head>

< body>

< a href =''popup.html''onclick =" window.open(''popup.html'','''',''width = 200,height = 200'');">点击我< / a>

< input id =''inputThing''type =''text''>< / input>

< / body>

< / html>

解决方案

欢迎来到TSDN - The Scripts。


Set专注于弹出窗口。


感谢欢迎。

我已经尝试过,但它不起作用:主窗口将焦点放在然而,弹出窗口,它将开始在href中加载页面并在弹出窗口之上。


展开 | 选择 | Wrap | 行号

Hey everyone, I''m currently working on a php project that started about 3 years ago (meaning, it''s already quite large.).

It uses quite a lot of pupups that seem to work great in all browsers... or used to until IE 7 came along.

The problem is, if I have a link that generates a popup but also relocates the page where the link was clicked, the main page will come on top of the popup when it starts loading (this does not occur in any other browser other than IE 7.). This occurs if the page has an onload event that sets focus somewhere in the page.

I will provide an over-simplified example, try it out in FF, IE 6, and IE 7 to see what I mean:

content of popup.html:
<html>
<head>
<script language=''javascript''>
window.onload = function (){ window.document.getElementById(''inputThing'').focus (); };
</script>
</head>
<body>
<a href=''popup.html'' onclick="window.open(''popup.html'','''',''width=200,he ight=200'');">Click Me</a>
<input id=''inputThing'' type=''text''></input>
</body>
</html>

解决方案

Welcome to TSDN - The Scripts.

Set focus to the popup window.


thanks for the welcome.
I already tried that, but it will not work: the main window will give the focus to the popup, however, afterwards it will start loading the page in the href and come on top of the popup.


Expand|Select|Wrap|Line Numbers


这篇关于使用弹出窗口时出现IE7问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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