Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-11-2012, 04:10 AM   PM User | #1
saleekr
New to the CF scene

 
Join Date: Jul 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
saleekr is an unknown quantity at this point
Hi need some Accorion menu help

Hi, i am a total newbie to jquery.
I have an accordion menu for a project that keeps bouncing as you rollover the submenu links.
If i only have the top level and 1 or 2 of the sub menu it works, but if there is too much or if i add a 3rd level it goes crazy.

Here is my code:
Code:
function mainMenu ()
{

	jQuery("nav ul li").hover(function () 
	{
	
		jQuery(this).find("ul").fadeIn(0).slideUp(0).slideDown(200);
	
	}, function () 
	{
		
		jQuery(this).find("ul").slideUp(200);		
	
	});
	
	jQuery("nav ul li").each(function () 
	{
	
		if (jQuery(this).find("ul").size() > 0) jQuery(this).find("a").filter(":first").append(" +");
	
	});

}
HTML (this is a wordpress theme, so the html just pulls from the default wordpress custom nav)

Code:
<nav>
		
			<?php wp_nav_menu(array("location" => "primary")) ?>
			
			<div id="mobile_menu_skin">
				
				<?php _e("Navigate To", "cluster") ?>…
				
				<span>+</span>
				
				<div class="clear"></div>
				
			</div>

		<div class="clear"></div>				
		
		</nav>
This is a video that someone use using the same wordpress theme took showing the problem.

http://youtu.be/lgbxWbmzbaw

So I am thinking that if the code is changed to a click action instead of a hover action this would work better??

Any help?
saleekr is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:44 AM.


Advertisement
Log in to turn off these ads.