Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

hide css layers onload?

0 views
Skip to first unread message

John

unread,
Jan 13, 2004, 1:16:24 AM1/13/04
to
I have a sub menu that is displayed on rollover using javascript to
show/hide the css layers. However, on loading of the page all of the layers
show for a few seconds until the entire page loads before they hide. How
can I hide these CSS layers as the page is loading?

in CSS there is an ID like #mylayer
in HTML in the BODY I have an ONLOAD="Init():"
in JavaScript I have in the Init() { [initialize]; [browser detect];
HideAllLayers(); }

Apparently the "HideAllLayers()" gets called pretty late. So, I was
wondering if there is a way to hide a layer in the CSS file (so that the
HideAllLayers() does not need to be initially called) somehow and still be
able to shown again when the ONMOUSEOVER="ShowAllLayers();" is called?

BTW, this latency is only a problem in IE (geee, what a surpise!)

TIA,
-John


Gonzalo Arin

unread,
Jan 13, 2004, 11:30:12 AM1/13/04
to
Try this:
<style type="text/css" >
#mylayer {
visibility:hidden;
}
</style>
This way all layers are already hidden when tha page loads.
Then, you can set the visibility:visible with javascript.
Gonzalo

"John" <re...@newsgroup.only> escribió en el mensaje
news:Y2MMb.8174$m53...@newssvr23.news.prodigy.com...

Alexey V.Zelenin

unread,
Jan 14, 2004, 10:56:36 AM1/14/04
to
Gonzalo Arin wrote:
> Try this:
> <style type="text/css" >
> #mylayer {
> visibility:hidden;
> }
> </style>
> This way all layers are already hidden when tha page loads.
> Then, you can set the visibility:visible with javascript.
> Gonzalo

I think maybe it's better to change the "display" property - not
"visibility"? Else the browser will reserve the place for invisible
control which maybe will break the page face.

0 new messages