View Full Version : Floating toolbar

Jul 25th, 2002, 10:45 PM
I have a toolbar that I want to have always visible at the top of the page. I was wondering if I could perhaps implement this with javascript or css. The only way I know of implementing this is by creating two frames, and I don't want to do that because I would lose months of work rewriting my site.
Thanks again,

Roy Sinclair
Jul 26th, 2002, 12:40 AM
For Mozilla and other Gecko based browsers you can use straight CSS:

<div style="position:fixed ; left: 0px; top: 0px;">The Content</div>

For IE you have to use position:absolute and reposition it each time the page is scrolled.

Jul 26th, 2002, 12:46 AM
Thanks for your reply.
I'm designing for IE...
How can I repositing the toolbar like you said?

Roy Sinclair
Jul 26th, 2002, 10:06 PM
The technique used by this (http://javascript.internet.com/navigation/portable-menu.html) script should show you how to make it happen.

Jul 26th, 2002, 10:24 PM
Again, thanks for the help....
Hum, the author of that script seems to have created confusing script on purpose. He has like 10 variables to call one freaking function, but I got the jist of it.
I also was creating something on my own on your suggestion.
I set the toolbar's position global style normally like you said, and then created a body onscroll function, which updated the position of the toolbar, with the index of the scrolltop function.
It was easier than what I had thought.