admin管理员组

文章数量:1357577

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();"> 

本文标签: javascriptPopup window always on topStack Overflow