<script>
document.addEventListener("DOMContentLoaded", function() {
$('.js-filter').eq(2).addClass('d-none');
$('.js-filter').eq(3).addClass('d-none');
$('.js-filter-option').click(function(){
setTimeout(function(){
let containsShoes = false;
let containsJeansOrPants = false;
$('.js-filter-option.active').each(function(){
if($(this).html() === 'Shoes') {
containsShoes = true;
}
if($(this).html() === 'Jeans' || $(this).html() === 'Pants') {
containsJeansOrPants = true;
}
});
if(containsShoes) {
$('.js-filter').eq(3).removeClass('d-none');
} else {
$('.js-filter').eq(3).addClass('d-none');
}
if(containsJeansOrPants) {
$('.js-filter').eq(2).removeClass('d-none');
} else {
$('.js-filter').eq(2).addClass('d-none');
}
}, 30);
});
});
</script>
Last active
March 9, 2021 23:42
-
-
Save arturmkrtchyan/e8168502a944a3636f5f63bd31816a09 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment