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 '

Create a section that can be removed on button click​ 2

Now, create a button or an icon, and give it the class ' clicktoclose '

Can also be any element. Title, image,  text etc.

Create a section that can be removed on button click​ 3

If you use a button, empty the link field.

Create a section that can be removed on button click​ 4

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

<script>

jQuery(document).ready(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>

jQuery(document).ready(function($){
$('.clicktoclose').click(function(){
$(this).parents('.closeclick').hide();
$(this).parents('.closeclick').next('.elementor-sticky__spacer').hide();
})
})
</script>
<style>
.clicktoclose{
cursor: pointer;
}
</style>

Another removable section example!

< News >

Get awesome new designs right in your inbox!

No spam, not more than one weekly email.

< Support me>

Support my work by buying Elementor Pro , or addons, through my links

< Recent Designs >

Visit the Learning Center For More Designs !

Created by <Elementor Codes>

Leave a Reply

Your email address will not be published. Required fields are marked *