Posted By

raondo on 07/13/06


Tagged

menu toggle navigation module


Versions (?)

Who likes this?

6 people have marked this snippet as a favorite

luman
raondo
visualAesthetic
jfherring
chrisburd
guo3823538


toggle module


 / Published in: JavaScript
 

A nice function to hide/display menu items in navigation.

  1. <SCRIPT LANGUAGE="JavaScript">
  2. function toggleMod(which) {
  3. var module = 'mod_' + which;
  4. if (document.getElementById(module).style.display == 'none') {
  5. document.getElementById(module).style.display = 'block'
  6. } else {
  7. document.getElementById(module).style.display = 'none'
  8. }
  9. </SCRIPT>
  10.  
  11. <a href="javascript:toggleMod('menu_headline');">menu_headline</a>

Report this snippet  

You need to login to post a comment.