PopUp焦点 - 如何? [英] PopUp Focus - How To?

查看:80
本文介绍了PopUp焦点 - 如何?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的小组


我想知道你是否可以帮助我。我有一个页面

包含一个按钮和一个IFrame。 IFrame包含一个虚拟页面,

设置为在加载时重定向到word文档,因此最终

word文档将显示在IFrame中。这很好用。没有

问题。


我唯一的麻烦就是父母

页面上的按钮。按下时,它会运行此脚本:


< script language = JavaScript>

window.open(''download.aspx'',''下载'',''width = 320,height = 150,resizable = no,scrollbars = no'');< / script>


打开一个小小的下载窗口文件可以

下载到客户端。窗口打开完全正常,但总是

结束在父页面后面,因为按钮点击不可避免

重新加载父页面(没关系)但是然后触发虚拟页面到

加载文件,将焦点放在页面上。所以

弹出窗口仅在前景中显示一秒钟然后

消失。

我试过放置一个window.focus虚拟页面上的(新窗口)脚本

然后我根本看不到弹出窗口。我可能会对window.focus脚本做错了,因为我在Java方面不太好。

如果您有任何想法,请告诉我。


非常感谢你的帮助和帮助。努力!

祝你有愉快的一天!


马丁

解决方案

<第************ @ hotmail.com>写了

我唯一的麻烦就是父母页面上的按钮。按下时,它运行此脚本:

< script language = JavaScript>

window.open(''download.aspx'',''download'',' 'width = 320,height = 150,resizable = no,sc

rollbars = no'');< / script>


为什么弹出窗口不可恭维?没有任何理由让

禁用此窗口功能,仅仅因为那些不会尝试

调整窗口大小的访问者永远不会注意到差异,那些尝试

吧,对于任何不经意的情况,只会发现他们不能!

给我一个很好的理由!

这会打开一个下载窗口,word文档可以下载到客户端。窗口打开完全正常,但总是
结束在父页面后面,因为按钮单击不可避免地重新加载父页面(没关系)




Haven没有看到你的代码,但我不明白为什么重装会不可避免地会花费b $ b。无论如何,要从开启者那里集中弹出窗口,你需要通过open()语句指定

a引用,如下所示:


var w = window.open (''stuff'',''stuff'',''stuff'');

w .focus();


hth

-

ivo


文章< 11 *************** *******@c13g2000cwb.googlegroups .com> ;,
th **** ********@hotmail.com 启发我们...

所以
弹出窗口只显示前景中的一秒钟然后
消失。




您是否尝试过:(注意自动换行!)


<脚本类型=" text / javascript">

//请注意语言属性已弃用:使用类型


var w = window.open('' download.aspx'','''下载'',''width = 320,height =

150,resizable = no,scrollbars = no'');

if(w!= null)w.focus();


< / script>


-

-

~kaeli~

耶稣拯救,真主保护,而且克苏鲁认为你会成功

a不错三明治。
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace


theintrepid ... @ hotmail.com写道:


(剪辑)

...父母
页面上的按钮....运行此脚本:


(剪辑)

打开一个一个小的下载窗口,word文档可以下载到客户端。窗口打开完全正常,但总是
结束在父页面后面,因为按钮单击不可避免地重新加载父页面(没关系)但是然后触发虚拟页面
加载将重点放在paren页面上的文档。所以
弹出窗口只在前景中显示一秒钟然后
消失。




(剪辑)


哇,这就像泥巴一样清晰。为什么按钮点击不可避免

[原文如此]

重新加载父页面 ?如果它是< button>按钮,试试这个:


< button ... onclick =" funcName();返回false;">


否则,请在''download.aspx''中试试这个:


< script type =" text / javascript">


self.focus();


< / script>


Dear Group

I wondered whether you can help me with this. I do have a page that
contains a button and an IFrame. The IFrame contains a dummy page that
is set to redirect to a word document when loaded so eventually the
word document will be displayed in the IFrame. That works all well. No
problem.

The only trouble I have is with the button contained on the parent
page. When pressed, it runs this script:

<script language=JavaScript>
window.open(''download.aspx'',''download'',''width=320, height=150,resizable=no,scrollbars=no'');</script>

which opens a little download window where the word document can be
downloaded to the client. The window opens perfectly fine but always
ends up behind the parent page because the button click unavoidable
reloads the parent page (That''s ok) but then triggers the dummy page to
load the document which will give the focus to the paren page. So the
pop-up is only shown for a second in the foreground and then
disappears.
I have tried placing a window.focus(newwindow) script on the dummy page
but then I can''t see the pop-up at all. I might do something wrong with
the window.focus script as I''m not so good in Java.
If you have any ideas, please let me know.

Thank you very much for your help & efforts!
Have a nice day!

Martin

解决方案

<th************@hotmail.com> wrote

The only trouble I have is with the button contained on the parent
page. When pressed, it runs this script:

<script language=JavaScript>
window.open(''download.aspx'',''download'',''width=320, height=150,resizable=no,sc
rollbars=no'');</script>

Why should your popup be unresizable? There really is no excuse for
disabling this window feature, simply because those visitors that don''t try
to resize the window will never notice a difference, and those that do try
it, for whatever unthought of circumstance, will only find that they can''t!
Give me one good reason!
which opens a little download window where the word document can be
downloaded to the client. The window opens perfectly fine but always
ends up behind the parent page because the button click unavoidable
reloads the parent page (That''s ok)



Haven''t seen enough of your code, but I don''t see why a reload would
unavoidable. Anyway, to focus the popup from the opener, you need to assign
a reference via the open() statement like so:

var w=window.open( ''stuff'', ''stuff'', ''stuff'' );
w .focus();

hth
--
ivo


In article <11**********************@c13g2000cwb.googlegroups .com>,
th************@hotmail.com enlightened us with...

So the
pop-up is only shown for a second in the foreground and then
disappears.



Did you try: (watch for word-wrap!)

<script type="text/javascript">
// note that the language attribute is deprecated: use type

var w = window.open(''download.aspx'',''download'',''width=320, height=
150,resizable=no,scrollbars=no'');
if (w != null) w.focus();

</script>

--
--
~kaeli~
Jesus saves, Allah protects, and Cthulhu thinks you''d make
a nice sandwich.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace


theintrepid...@hotmail.com wrote:

(snip)

...the button contained on the parent
page....runs this script:
(snip)
which opens a little download window where the word document can be
downloaded to the client. The window opens perfectly fine but always
ends up behind the parent page because the button click unavoidable
reloads the parent page (That''s ok) but then triggers the dummy page to load the document which will give the focus to the paren page. So the
pop-up is only shown for a second in the foreground and then
disappears.



(snip)

Wow, that''s as clear as mud. Why does the "button click unavoidable
[sic]
reloads the parent page" ? If it''s a <button> button, try this:

<button...onclick="funcName();return false;">

Otherwise, try this in ''download.aspx'':

<script type="text/javascript">

self.focus();

</script>


这篇关于PopUp焦点 - 如何?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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