Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Crocoblock/f5e383ce341e94904959b83c329497aa to your computer and use it in GitHub Desktop.
Save Crocoblock/f5e383ce341e94904959b83c329497aa to your computer and use it in GitHub Desktop.
<style>
.jet-filter-label:after {
content: "˅";
float: right;
margin-right: 10px;
}
.jet-filter-label.noicon:after{
content: "";
}
.jet-filter-label {
cursor: pointer;
}
.jet-filter-label.noicon {
cursor: pointer;
}
</style>
<script>
document.addEventListener('DOMContentLoaded', function() {
makeCollapsible();
jQuery( document ).on( 'elementor/popup/show', function( event, id, instance ) {
if ( id ) {
makeCollapsible();
}
} );
});
window.addEventListener( 'elementor/popup/show', function( event, id, instance ) {
if ( id ) {
makeCollapsible();
}
});
function makeCollapsible() {
jQuery(function($){
$('.jet-checkboxes-list:not(.collapsible-applied)').slice(0).slideUp(
500,
function() {
$( this ).addClass( '.collapsible-applied' );
$( this ).prev( '.jet-filter-label' ).click(function() {
$(this).next().slideToggle();
if (!$(this).hasClass('noicon')){
$(this).addClass('noicon');
}
else {
$(this).removeClass('noicon');
}
});
} );
});
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment