最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Popup window always on top - Stack Overflow

programmeradmin1浏览0评论

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.

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.

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

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.

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.

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

Share Improve this question asked Aug 30, 2010 at 17:37 Alec SmartAlec Smart 96k39 gold badges124 silver badges186 bronze badges 2
  • 1 Please don't do this, however legitimate your purpose if it's not optional it's unwele (albeit this is my own opinion, and causes me to leave sites even more rapidly than blinking banner ads). – David Thomas Commented Aug 30, 2010 at 17:48
  • See newer answers here: stackoverflow./questions/14565310/… – Erel Segal-Halevi Commented Jan 30, 2013 at 8:13
Add a ment  | 

1 Answer 1

Reset to default 3

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();"> 
发布评论

评论列表(0)

  1. 暂无评论