Last active
December 1, 2015 18:49
-
-
Save zenaul/82543d9e75bde40ca1a5 to your computer and use it in GitHub Desktop.
Category Menu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*--------------------- | |
Category menu | |
--------------------- */ | |
$('#cate-toggle li.has-sub>a').on('click', function(){ | |
$(this).removeAttr('href'); | |
var element = $(this).parent('li'); | |
if (element.hasClass('open')) { | |
element.removeClass('open'); | |
element.find('li').removeClass('open'); | |
element.find('ul').slideUp(); | |
} | |
else { | |
element.addClass('open'); | |
element.children('ul').slideDown(); | |
element.siblings('li').children('ul').slideUp(); | |
element.siblings('li').removeClass('open'); | |
element.siblings('li').find('li').removeClass('open'); | |
element.siblings('li').find('ul').slideUp(); | |
} | |
}); | |
$('#cate-toggle>ul>li.has-sub>a').append('<span class="holder"></span>'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment