Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Window / layer always on top

Status
Not open for further replies.

IL

Programmer
Jan 7, 2002
15
SE
Hi everybody !

I'm working with floating menus. There is one which I like a lot because you can move it about where ever you like on the screen. It moves very ' clean '. It's made from a layer with z-order 10. When you click on a menu item and get moved to another window, the floating menu does not come with you. It seems it is only relative to it's own window, so to speak. Is there a way to have this layer on top all the time. Lets say, when you come to the start page you are given a choice if you want to use this floating menu. You click on ' something ' to say yes, and the menu appears - and after that it should stay with you through the complete session that you visit that site.
Is this 'Do-able'??

IL
 
You'd need to take the menu out of a layer and into it's own window. Then it would be do-able. In fact, then it would be quite easy as all you would have to do was continually have the menu window bring itself into focus.
 
Hi,

yes I was also thinking of a separate window, but it looks a lot nicer as a layer.
By the way, what would the code look like for a separate window, which keeps it's focus continually. Normally as soon as you click on the new page you've moved on to the 'menu' window will minimize. I would like for it to stay on top continually. Can you do this ??
I haven't really done any programming in javascript before,
only very short, small functions, so I don't know much code.
Grateful for any of help.

IL
 
<html>
<head>
<title>You can't hide me</title>
<script>
function keepfocused(){
self.focus();
var x = setTimeout(&quot;keepfocused()&quot;, 100);
}
</script>
</head>
<body>
Just try to keep me hidden
</body>
</html>


Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.
 
Hi again,

just want to thank you for your help.

I've gotten myself some books on Javascript now.

Cheers !!

IL
 
how about even meaner:
[tt]
<html>
<head>
<title>You can't hide me</title>
<script>
function keepfocused(){
self.focus();
var x = setTimeout(&quot;keepfocused()&quot;, 100);
}
</script>
</head>
<body onblur=&quot;self.focus();&quot;>
Just try to keep me hidden
</body>
</html>
[/tt]

Of course, this kind of annoyance just makes it more likely folks will just turn off javascript (none of the above will work then) by default. And we don't want that do we?

Posting code? Wrap it with code tags: [ignore]
Code:
[/ignore][code]CodeHere
[ignore][/code][/ignore].
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top