Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
JavaScript
<script type="text/javascript">
	    $(document).ready(function () {

	        // Store variables

	        var accordion_head = $('.accordion > li > a'),
				accordion_body = $('.accordion li > .sub-menu');

	      

	        // Open the first tab on load

	        accordion_head.first().addClass('active').next().slideDown('normal');

	        // Click function

	        accordion_head.on('click', function (event) {

	            // Disable header links

	            event.preventDefault();

	            // Show and hide the tabs on click

	            if ($(this).attr('class') != 'active') {
	                accordion_body.slideUp('normal');
	                $(this).next().stop(true, true).slideToggle('normal');
	                accordion_head.removeClass('active');
	                $(this).addClass('active');
	            }

	        });

	    });

	</script>
i m using this accodion menu on master page,and i want selected item menu and page at a time and when i click 2nd submenu it will expand 1st menu insteed of showing 2nd sub menu...
Posted
Updated 24-Jan-13 0:14am
v2

try these Accordion[with source] using jquery.
 
Share this answer
 
Put your script tag in the "Head" of the MasterPage, it should work.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900