how to make popup windows always on top?

Deadly 提交于 2019-12-01 22:26:43
myWindow.focus()

Many modern browsers prevent this from working, but it's the only way.

maryam

use following javascript code in the page you are opening in popup

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

Im sure you cannot control the order of the window. Instead of a popup (which is often and usually blocked by browsers) why not investigate using a lightbox javascript plugin. They are usually free, stylish and work well.

Cmail Ultimate

Just set it from the modal css. The z-index is normally set to 1. Just change it to 9999. That is the purpose of the z-index, to set the popup top level.

If not using bootstrap popup, then you need to use css to set it. Browsers are not guaranteed to place nice with .focus() on a window.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!