Solved

Keeping a window on top

Posted on 2000-05-05
8
172 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
I tried the OnLoad suggestion from webhornet. It didn't work.
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 9

Accepted Solution

by:
Dain_Anderson earned 50 total points
Comment Utility
In the new window you create, put:

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

Hope that helps.
0
 

Author Comment

by:winkle
Comment Utility
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
Comment Utility
UHM, well....guess not, it works for me. BTW, I said it before Dain did...

Never mind *laughs*.

CJ
0
 

Expert Comment

by:Lisbona
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

762 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

11 Experts available now in Live!

Get 1:1 Help Now