Removing the Last Empty (Ghost) Slide in the Webflow CMS Slider

In my last project, I ran into a problem where a CMS-driven slider on Webflow would keep displaying the last slide which has no content, even though it has a conditional visibility set in place to not display that slide if it has no image.

Turns out there is a really simple solution. Just add this code to before </body> tag on the page where you have your slider:

<script>
   document.addEventListener("DOMContentLoaded", function(event) {
       $(".w-condition-invisible").remove();
   });
</script>

Publish your site and you should be ready to go with a perfectly working CMS slider.

Let's create something special together

Contact now

Related Posts

What are you waiting for?

Grow your business through design today