Jump to content

Necesito ayuda dropdown-menu


alg1978

Recommended Posts

Buenas tengo un menu con varias categorias , pero cuando pulso otro boton del menu no se cierra el anterios. Como podria solucionarlo?

Espero que me podais ayudar ..Gracias

 

 

jQuery(function ($) {
    "use strict";
    $("#off-canvas-menu .mega .fa-angle-down").click(function (e) {     
        e.preventDefault();     
        var _parent = $(this).parent();
        var _dropdown = _parent.next('.dropdown-menu');
        var _grandparent = _parent.parent();        
        if(_grandparent.hasClass('open')) {
            _grandparent.removeClass('open');
            _dropdown.slideUp("normal");
            $(this).removeClass('open');
            $(this).addClass('fa-angle-down');
        } else {            
            _grandparent.addClass('open');          
            _dropdown.slideDown("normal");
            $(this).removeClass('fa-angle-down');
            $(this).addClass('fa-angle-up');
        }
    })
    $(".mega .fa-angle-down").mouseover(function (e) {       
        e.preventDefault();
        return false;        
    })
    $("#off-canvas-menu li a").mouseover(function (e) {       
        e.preventDefault();
        return false;
        
    })  
});

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...