Indexhibit accordion menu


/ Published in: jQuery
Save to your folder(s)

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.


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.