homepage Welcome to WebmasterWorld Guest from 54.227.12.4
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
window on top
smagaz




msg:586106
 5:42 pm on Jul 28, 2001 (gmt 0)

Is it possible , in javascript, to keep a window always on top ?
I open a new small window in a target called "details" and I want it to remain visible or to close automatically when the main window is selected again. Otherwise the small window disappear behind the main one and whenever a new information is asked the small window remains behind and does not appears on top !
Am I clear !?!

thanks
Salva

 

rcjordan




msg:586107
 6:00 pm on Jul 28, 2001 (gmt 0)

Welcome to WebmasterWorld, smagaz.

Yes, it can be done with javascript. Here are a couple of resources:
[developer.irt.org...]
[webreference.com...]

tedster




msg:586108
 10:45 pm on Jul 28, 2001 (gmt 0)

>> I want it to remain visible or to close automatically when the main window is selected again. <<

smgagaz, thanks for the idea that the new window could close automatically. It's such a direct solution that I smack myself in the head for not coming up with it. The code for automatically closing the new window could go in the BODY tag for the top window's document, like this:

<body onBlur="self.close()">

I've been using

<body onBlur="self.focus()">

That gets tricky on some browsers (like Netscape) which still allow temporary focus for another page. There's also the chance of an infinite loop, if the code ends up on a machine where another open window also has similar code. This is a much more graceful solution.

tedster




msg:586109
 7:37 pm on Jul 31, 2001 (gmt 0)

I just implemented the onBlur=self.close() in a few places and discovered one glitch to watch out for. The moment someone clicks anywhere in the pop-up window, registering that click requires a Blur event (in both IE and NN) and the pop-up window closes -- the link isn't followed, even if it was supposed to open a new window!

This means that any links on the pop-up page are essentially non-functional. With onBlur=self.focus(), the links will load, but stay behind the open pop-up to be viewed when that pop-up is closed by hand.

ggrot




msg:586110
 7:56 pm on Jul 31, 2001 (gmt 0)

The same is probably true with form elements. This is because the element(whether it be a form or an anchor) gets the focus when you click it.

tedster




msg:586111
 8:21 pm on Aug 4, 2001 (gmt 0)

> the element (whether it be a form or an anchor) gets the focus when you click it.

IT seems that the click can be anywhere on the page, even on the background, and the focus leaves the window -- which closes it. Interesting situation. Even a right click has the effect of closing the window, but only after the menu choice you make is executed (i.e. view source).

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved