/ 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.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<script type='text/javascript'> $(function() { /* Accordion Menu for Indexhibit uses jquery * * Created by G470 Jul 2011 */ /*** first hide all sub Elements ***/ $aswt = $("#menu .container ul li.section-title"); $aswt.nextAll().hide(); /*** cursor for the section title ***/ $aswt.css({'cursor':'pointer'}); /*** remove the next line if you don't want to show active menu by default ***/ $('#menu .container ul li.active').parent().children().show(); /*** click function for section title ***/ $aswt.click(function(){ if($(this).next().is(':visible')){$aswt.nextAll().hide(500); }else{ $aswt.nextAll().hide(500); $(this).nextAll().slideToggle(500); }; }); }); </script>