Posted By

G470 on 07/12/11


Tagged

menu jquery accordion indexhibit


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

spee66


Indexhibit accordion menu


 / Published in: jQuery
 

to make use of this snippet you have to update the jquery.js file in your ndxz-studio/site/js folder to a new version.

  1. <script type='text/javascript'>
  2.  
  3. $(function() {
  4. /* Accordion Menu for Indexhibit uses jquery
  5.  *
  6.  * Created by G470 Jul 2011
  7. */
  8.  
  9. /*** first hide all sub Elements ***/
  10. $aswt = $("#menu .container ul li.section-title");
  11. $aswt.nextAll().hide();
  12. /*** cursor for the section title ***/
  13. $aswt.css({'cursor':'pointer'});
  14. /*** remove the next line if you don't want to show active menu by default ***/
  15. $('#menu .container ul li.active').parent().children().show();
  16. /*** click function for section title ***/
  17. $aswt.click(function(){
  18. if($(this).next().is(':visible')){$aswt.nextAll().hide(500);
  19. }else{
  20. $aswt.nextAll().hide(500);
  21. $(this).nextAll().slideToggle(500);
  22. };
  23. });
  24. });
  25.  
  26. </script>

Report this snippet  

You need to login to post a comment.