Skip to content

Instantly share code, notes, and snippets.

@nocodesupplyco
Created December 16, 2022 19:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nocodesupplyco/22c5fb0a3aaa77562e544cada231165c to your computer and use it in GitHub Desktop.
Save nocodesupplyco/22c5fb0a3aaa77562e544cada231165c to your computer and use it in GitHub Desktop.
Hide Static Element if Webflow Collection is Empty
// Option 1 - Check if Empty element is present/visible
$(function() {
if($('#LIST-WRAPPER').find('div.w-dyn-empty').length !== 0){
$('#SECTION').hide();
}
});
// Option 2 - Check if collection list element is conditionally hidden due to being empty
$(function() {
if($("#LIST-WRAPPER").hasClass("w-condition-invisible")){
$("#SECTION").hide();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment