Skip to content

Instantly share code, notes, and snippets.

@ChiaYiLai
Created February 11, 2015 06:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChiaYiLai/87988e2d70baa318c747 to your computer and use it in GitHub Desktop.
Save ChiaYiLai/87988e2d70baa318c747 to your computer and use it in GitHub Desktop.
側選單開闔功能
$('.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