talk2toyin Posted November 17, 2013 Share Posted November 17, 2013 I'm trying to use jquery effects for a menu system that lists out archives pulled dynamically from the database. The menu will be like this: 2013> . Jan . Feb . Mar . All 2012> . Jan . Feb . Mar . All and so on... The sub links will be hidden when the pages loads and then, on clicking any of the listed year, the sub links(months) are displayed or hidden using the jquery blind effect. Here's my html: <div class='arch'> <ul class='nav nav-list'> <li class='dropdown arch-dropdown'> <a href='#' class='' toggle-dropdown='dropdown'>2013 <span class='caret'></span></a> <ul class='arch-menu'> <li><a href='#' class='active'>Jan</a></li> <li><a href='#' class='active'>Feb</a></li> <li><a href='#' class='active'>Mar</a></li> </ul> </li> <li class='dropdown arch-dropdown'> <a href='#' class='' toggle-dropdown='dropdown'>2012 <span class='caret'></span></a> <ul class='arch-menu'> <li><a href='#' class='active'>Jan</a></li> <li><a href='#' class='active'>Feb</a></li> <li><a href='#' class='active'>Mar</a></li> </ul> </li> </ul> </div> I'm using Bootstrap for my HTML and CSS. Sorry if there are any mistakes in my html code, i had to type with my phone, off hand. My JQuery: $(document).function({ $(".arch-dropdown").click(function() { $(".arch-menu").toggle("blind", 500); }); }); but the above code only makes the whole sub-links of all the listed archives toggle. I can't seem to get it to work for only which was clicked. Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/284005-how-do-i-refrence-the-class-or-id-of-a-sub-menu-when-the-parent-list-item-is-clicked/ Share on other sites More sharing options...
talk2toyin Posted November 18, 2013 Author Share Posted November 18, 2013 Sorry, only the currently active .arch-menu have the .active class; ignore others please. urgent help needed. thanks Quote Link to comment https://forums.phpfreaks.com/topic/284005-how-do-i-refrence-the-class-or-id-of-a-sub-menu-when-the-parent-list-item-is-clicked/#findComment-1458762 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.