Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
$(".category-wrap span").click(function(){
if($(".sub-catalog").is(":visible") == true){
$(this).parent().find(".sub-catalog").slideUp();
$(this).find(".fa").addClass("fa-angle-right");
$(this).find(".fa").removeClass("fa-angle-down");
if($(this).parent().find(".sub-catalog").is(":hidden") == true){
$(".sub-catalog").slideUp();
$(this).parent().find(".sub-catalog").slideDown();
$(".category-wrap span").find(".fa").removeClass("fa-angle-down").addClass("fa-angle-right");
$(this).find(".fa").addClass("fa-angle-down");
}
}
else{
$(this).parent().find(".sub-catalog").slideDown();
$(this).find(".fa").addClass("fa-angle-down");
$(this).find(".fa").removeClass("fa-angle-right");
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment