Last active
May 28, 2022 12:37
-
-
Save dislokacia/76ff0da45b274e9ec258a366fa03ed83 to your computer and use it in GitHub Desktop.
JetSmartFilters indexer doesn't hide the margins from empty columns
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function( $ ){ | |
//on page load remove margins for the hidden filters | |
$( '.jet-filter:hidden').closest('.elementor-element').addClass('hide_margin'); | |
//on applying the filters add the class to the hidden filters to remove the margins | |
$( document ).on( 'jet-filter-content-rendered', function() { | |
setTimeout(function() { | |
$( '.jet-filter:hidden').closest('.elementor-element').addClass('hide_margin'); | |
}, 100); | |
}); | |
//to remove the class when disable or check another filter | |
$( document ).on( 'change', function() { | |
$( '.elementor-element' ).removeClass('hide_margin'); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*css*/ | |
.hide_margin { | |
margin-bottom: 0!important; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment