Solved

Keeping a window on top

Posted on 2000-05-05
8
173 Views
Last Modified: 2012-05-04
I'm using Javascript1.2, in both IE 5 and Netscape 4.6.   I have a javascript funciton that opens a window. I need for this window to always be on top. Currently I'm using the alwaysRasied feature (though I can't guarentee that users will have UniversalBrowserWrite privilege). In addition this doesn't work in IE. (according to my docs)

Is there a way to do this?

Here's my current open call:

  var w=window.open('','winName', config='height=250,width=500,resizable=yes,scrollbars=yes,alwaysRaised=yes,menubar=yes,screenX=0,left=0,top=0');

If the answer is no - then is there a way I can find a window object by name? I could then close the window and reopen it. Though that's not very efficient.

Thanks
0
Comment
Question by:winkle
8 Comments
 
LVL 22

Expert Comment

by:CJ_S
ID: 2783529
what you could do is that when the focus chenges you just set the focus back again. Like inside the Body tag you put: onBlur='this.focus()'

0
 

Expert Comment

by:webhornet
ID: 2784847
you probably can't use the unBlur in the body tag because this is not valid according html4.

try this:
<BODY onLoad="window.setInterval('this.focus()',10)"
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 2785334
HMMMMM......true!
you can put a function in it which loops through every object in the page and when there is NO object focussed then you focus back *that function should be called in the onBlur of all the other object*.....doesn't seem like a good idea to me at all though.
0
 

Author Comment

by:winkle
ID: 2793993
I tried the OnLoad suggestion from webhornet. It didn't work.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 9

Accepted Solution

by:
Dain_Anderson earned 50 total points
ID: 2795325
In the new window you create, put:

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

Hope that helps.
0
 

Author Comment

by:winkle
ID: 2797794
The onBlur does work, I didn't try it because webhornet stated that it's not a valid tag in HTML4. Is this going to be a problem?
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 2799112
UHM, well....guess not, it works for me. BTW, I said it before Dain did...

Never mind *laughs*.

CJ
0
 

Expert Comment

by:Lisbona
ID: 2940909
i do not undestand somthing,
the <body onBlur="self.focus()"> will make the small wilnow on top but will not let you work in it (if it is a document for example)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now