Created
February 11, 2015 06:45
-
-
Save ChiaYiLai/87988e2d70baa318c747 to your computer and use it in GitHub Desktop.
側選單開闔功能
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
$('.side').find('li').each(function(){ | |
var $this = $(this); | |
if($this.children('ul').length > 0){ | |
$this.append('<i class="fa fa-chevron-down"></i>'); | |
} | |
$this.find('.fa').on('click', function(){ | |
$(this).parent('li').toggleClass('open'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment