1 reply [Last post]
bionnaki
Offline
newbie
Last seen: 17 years 38 weeks ago
Joined: 2004-05-08
Posts: 1
Points: 0

http://www.psidonia.net

CSS newbie here Smile

If you notice the menus on both sides, you can click "drop menu" and the links collapse.

When the site loads, the menus are expanded. I am wondering if it possible to have them load collapsed. I'd like to have them hidden at first, but if the viewer wishes to see the links, they can click & expand them.

anyone know how to correct this? I am sure its real easy - I just cannot figure it out.

thanks!

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 2 weeks 1 day ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5344
Points: 2965

.::dropdown menu problem::.

Hi bionnaki,
If you set all the dd styles to display:none in your css file they will be hidden when the page first loads.

But a better way may be to use javascript to hide them as if the browsers don't have javascript enabled the whole menu will still be available.
Something like this would be an easy way to do it.

<script type="text/javascript"> 
window.onload=function{ 
   document.getElementById("dd1").style.display="none"; 
   document.getElementById("dd2").style.display="none"; 
   document.getElementById("dd4").style.display="none"; 
   document.getElementById("dd5").style.display="none"; 
} 
</script>

Hope that helps