Automatic Elementor popup menu closing on clicking link

Automatic Elementor Pop up menu closing on clicking link

Need your Elementor popup menu to close automatically when someone clicks a link inside it? In this tutorial, I’ll show you exactly how I solved that problem with a simple custom script. By default, Elementor’s popups are great for mobile menus and call-to-action panels, but they can feel clunky when the popup stays open after a user chooses a menu item.

In this post, we’ll walk through the logic behind closing the popup on link click, look at the code I used, and see how you can adapt it to your own layout. You’ll learn where to place the code, how it interacts with Elementor’s popup settings, and how to make sure it works smoothly on both desktop and mobile.

Whether you’re building a fullscreen mobile menu or a small popup navigation, this quick tweak will make your site feel more polished and user-friendly — no extra plugins required.

<script>
jQuery(function($){
$(document).on(‘click’,’.elementor-location-popup a’, function(event){
elementorProFrontend.modules.popup.closePopup( {}, event);
});
});
</script>

Elementor Close PopUp on Click for Menu & Same Page Links

 

Leave a Reply

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

Latest tutorials

Freelancer Mojibur
freelancer mojibur

Start a Project!

Interested in working together? Send a quick message or schedule a meeting. Ask questions, discuss details, and decide if we are a good fit.

Website Project Inquiry

This form helps me get a general idea. We’ll schedule a meeting soon to discuss everything in more detail!

Freelancer Mojibur

Contact person

For quick communication email at: freelancermojibur@gmail.com