Why is this piece of code here not working?
// Show clothing items sections
function showingSection(e) {
$(e).fadeIn('slow');
$(e).css('display', 'flex');
};
$('#accesories').click(function(){
$('.all-items').css('display', 'none');
showingSection('.accesorie');
// $('.accesories').fadeIn('slow');
// $('.accesories').css('display', 'flex');
});
I am going to be reusing the code that it’s inside the “showingSection” function when I click a certain element and I would like to avoid repeating the code over and over again, I know that I can like a toggle class but I am wondering if this could be achieve the way I am trying it to do.