Click here to Skip to main content
11,576,993 members (61,458 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET
<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 23-Jan-13 23:55pm
Edited 24-Jan-13 0:14am
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Put your script tag in the "Head" of the MasterPage, it should work.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

try these Accordion[with source] using jquery.
  Permalink  

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

  Print Answers RSS
0 DamithSL 155
1 Sergey Alexandrovich Kryukov 131
2 OriginalGriff 115
3 Afzaal Ahmad Zeeshan 95
4 Abhinav S 90
0 OriginalGriff 820
1 Sergey Alexandrovich Kryukov 631
2 Abhinav S 528
3 F-ES Sitecore 420
4 Suvendu Shekhar Giri 365


Advertise | Privacy | Mobile
Web04 | 2.8.150603.1 | Last Updated 25 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100