• Resolved sioy

    (@sioy)


    Advanced Sidebar Menu is one of the most useful plugins I have come across.

    I note that someone else asked about making it work accordion-style with grandchildren. Is there a chance that function could be built into the widget?

    In short, I want to use your widget, but I also have to be able to shorten & style my menus with a jquery accordion.

    Cheers.

    http://wordpress.org/extend/plugins/advanced-sidebar-menu/

Viewing 1 replies (of 1 total)
  • Plugin Author Mat Lipe

    (@mat-lipe)

    Hi sloy,

    Please take a look at the examples on this thread
    http://wordpress.org/support/topic/plugin-advanced-sidebar-menu-accordion-menu

    Half way through the thread broke into two columns so you will have to look on the right side.

    I believe the final code was something like this

    jQuery(document).ready( function($) {
    	//Adds a class to keep track if we are on a parent of child page
    	$('.current_page_item').next().addClass('sidebar-menu-hover');
    
    	//Make the menu open and close by hovering when on a parent page
        $(".child-sidebar-menu.sidebar-menu-hover > li > a").hover(function(){
        	//Slides open and closed the grandchild menu
             $(this).parent().find('ul').slideToggle(400);
             			return false;
         }, function(){
        	 return false;
         });
    
        //Make the menu open and close by clicking if on a child or grandchild page
        $(".child-sidebar-menu > li > a").not(".child-sidebar-menu.sidebar-menu-hover > li > a").click(function(){
        	//If there all no children link the link return Otherwise stop the link
        	if( $(this).parent().find('ul').slideToggle(400).length > 0 ){
        		return false;
        	} else {
        		return true;
        	}
         });
    
        //Initially hides the grandchild menu
        $('.child-sidebar-menu ul').hide();
    
        //Initially show the grandchild menu if on a grandchild or child pages
        $('.child-sidebar-menu ul li.current_page_item').parent().show();
        $('.child-sidebar-menu ul li.current_page_item ul').show();
        $('.child-sidebar-menu li.current_page_item ul').show();
    });

    Hope this helps.

    Cheers

Viewing 1 replies (of 1 total)
  • The topic ‘Accordian’ is closed to new replies.