Welcome, awesome readers! Subscribe to my mailing list to receive these amazing designs right in your inbox! (this is the example section for this article, set to sticky: top)
Create a section that goes away on button or icon click
No extra plug-ins required! Elementor Free Compatible.
Similar to what E Pro pop ups offers, but it has some advantages and disavantages.
Advantages: When you want to place something at the top of the page and that it does NOT cover the header, this will work. Quicker load than pop ups. Can remove sections that are part of the content, not over the content.
Disadvantages: Cannot set display conditions, it shows up at every page load.
[CLOSE]
To begin with, give the section that you want to close on click a CSS class of ' closeclick '

Now, create a button or an icon, and give it the class ' clicktoclose '
Can also be any element. Title, image, text etc.

If you use a button, empty the link field.

Finally, add this code in an html element on the same page

<script>
document.addEventListener('DOMContentLoaded', function() {
jQuery(function($){
$('.clicktoclose').click(function(){
$(this).parents('.closeclick').hide();
});
}); });
</script>
<style>
.clicktoclose{
cursor: pointer;
}
</style>
Specifically and only if you want that section sticky AND at the top of the page, use this code instead
<script>
document.addEventListener('DOMContentLoaded', function() {
jQuery(function($){
$('.clicktoclose').click(function(){
$(this).parents('.closeclick').hide();
$(this).parents('.closeclick').next('.elementor-sticky__spacer').hide();
});
}); });
</script>
<style>
.clicktoclose{
cursor: pointer;
}
</style>