弹出窗口始终位于顶部 [英] Popup window always on top

查看:87
本文介绍了弹出窗口始终位于顶部的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究可能使窗口始终位于顶部的任何黑客(除了window.focus())之外。也许一个隐藏的文本框,我可以设置焦点等。

Am looking at whatever hacks that are possible to keep a window always on top (apart from window.focus()). Maybe a hidden textbox to which I can set focus etc.

每当有新消息到达时,我都会在LivePerson(支持)中看到这种情况。我有合法的使用这个,而不是惹恼用户广告或任何东西。

I see this happening in LivePerson (support) whenever a new message arrives. I have legitimate use of this and not to annoy users with ads or anything.

任何浏览器的任何黑客都会做。我不是在寻找一个完整的跨浏览器解决方案。我认为window.focus可以用于Internet Explorer,但我还没有测试它。

Any hacks for any browsers will do. I am not looking at a complete cross-browser solution. I think window.focus would work for Internet Explorer, though I am yet to test it.

推荐答案

此JavaScript代码将放置弹出窗口在所有其他打开的浏览器窗口之上,直到查看器关闭包含这个小JavaScript代码的窗口:

This JavaScript code will place the popup window on top of all other open browser windows until the viewer closes the window containing this little JavaScript code:

<body onblur="self.focus();"> 

这篇关于弹出窗口始终位于顶部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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