View Full Version : child Window always on TOP

11-15-2006, 11:10 AM
Hi All,

I am opening a popup window by clicking a link. It should be always on TOP. what shall i do ? I have tried alwaysRaised=1 like this by using window.open. But It doesn't work properly.

Please assist me.....


11-15-2006, 11:40 AM
Hi there.

It would have been helpful if would have included your code so that we could help you out.

anyway..here is a quick solution...which may be very different to what you had already written...

var newWindow = window.open( '','','scrollbars=yes,menubar=no,height=460,width=960,resizable=yes,toolbar=no,location=no,status=no ');
newWindow.document.write( "text in new window goes here" );
newWindow.document.write( "text in new window goes here" );
newWindow.document.write( "text in new window goes here" );
newWindow.focus(); // this should bring the focus

Note..you should include the above script in a function...and call it when when you want the popup to appear. if you just dump it in a page as it is..it would just open the popup with every page refresh...not a lot people like that.

good luck

11-15-2006, 11:51 AM
thanks for quick reply ess.

I have tried this code also. But it doesn't work.
Actually my situation as follows,

I have opened a child window childWin from parentWin. after that i can able to navigate entire site. But the childWin should be always on TOP. this is what i want

11-15-2006, 12:23 PM
I see what you mean now...

what about trying this out.

newWindow.onblure = function() { newWindow.self.focus(); };

hope that would do the trick.

good luck.

11-15-2006, 01:39 PM
And why don't you use a modal window?


11-15-2006, 09:49 PM
1. blur is not a standard window event and so not all browsers support it.
2. modal windows only exist for Internet Explorer and for Firefox running on an intranet
3. the only cross browser way to do it is within the same window using a lightbox script or similar.