开发者

How to make all your pop up windows created by page appear on top when new one is created?

So imagine we have a full screen browser opened our page. So it ocupates all screen space.

we have some buttons for openng pop ups when user wants w开发者_JS百科ith code like:

<hr> <ul> 
<li><FORM><INPUT class="eButton" type="button" value="georg" onClick="window.open('./georg.flv?action=read','georg','width=400,height=200,left=0,top=100,screenX=0,screenY=100')"></FORM></li> 
<li><FORM><INPUT class="eButton" type="button" value="vasia" onClick="window.open('./vasia.flv?action=read','vasia','width=400,height=200,left=400,top=100,screenX=400,screenY=100')"></FORM></li> 
</ul> <hr>  

When user will click on one pop up will be created on top of window on which he clicked.

But when he will want to create a new one he will click on his full screen window with buttons and that window will owerlay created previosly pop up.

But If we want something like: (which here I created manually)

How to make all your pop up windows created by page appear on top when new one is created?

Where all our pop ups are on top. What shall we do? an JS functions that could help?

Windows with streams should be not inside main page. they should be stand alone.

Here point isto change main page code so to controll that all popups are on top.


Get your JavaScript code out of the markup (yeck!). Grab the handle to the window and use focus or blur.

<script>
openWin = function(name){
    var win = window.open('./'+name+'.flv?action=read', name, 'width=400, height=200, left=0, top=100';

win.focus() // on top
win.blur() // on bottom - this may not work, you may need to focus the current window:
window.focus();
}
</script>

<FORM><INPUT type="button" value="georg" onClick="openWin(this.value);"></FORM>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜