Jump to content

drop down menu css


piotr

Recommended Posts

Hi,

 

I have a drop down menu which takes records from a databse. After a top level link is clicked you are redirected to a category site and the drop down menu reveals subcategory links. But the menu shows it only for a while, when the site is reloaded the menu hides subcategories.

I tried to use onload event but without results.

 

<a href="category,<?=$row_catname[$q]['id']?>.html" 
onClick="switch('<?=$row_catname[$q]['id']?>','block','none' );return true;" class="category">
<?=$row_catname[$q]['title'];?></a>(<?=$nocat;?>)

 

function switch(id,typeA, typeB) { 

   try {
       var currentType = document.getElementById(id).style.display;
       var newType = typeA;
       if(currentType == typeA) {
           newType = typeB;
       } else if (currentType == typeB) {
           newType = typeA;
       }
       document.getElementById(id).style.display=newType;
       return newType; 
   } catch(e) {
       //alert( e.message );
   }
}

 

 

Thanks in advance

Link to comment
https://forums.phpfreaks.com/topic/163971-drop-down-menu-css/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.