Solved

Keeping a window on top

Posted on 2000-05-05
8
177 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:winkle
ID: 2793993
I tried the OnLoad suggestion from webhornet. It didn't work.
0
 
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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

763 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