Unverified

Name

Elementor-Dynamic-Pop-Up-Loop

Language

HTML

Rating

Voted: 0 by 0 user(s)

Codevault

WebSquadron

Scroll down to see more snippets from this codevault.

Wordpress Compatability

The author has indicated that this snippet is compatable up to wordpress version: 6.4

Code Snippet Plugin Sync

Free & Pro

Download this snippet by clicking the download button, then head over to the Code Snippet Plugin settings in your wordpress admin dashboard, select the import menu then upload this file to import into your wordpress site.

Pro Only (Coming Soon)

You will be able to click a button and sync this snippet to your wordpress site automatically and from your dashboard manage all code snippets across all your wordpress sites that have the Code Snippets Pro plugin installed.

History

Last modified:

28/08/2024

Important Note

This snippet has the following status:

Unverified

This snippet has not been verified, use with caution and at your own risk. See details provided by author in sidebar and click below to find out more.

Elementor-Dynamic-Pop-Up-Loop

 
                    
1<style>
2 .container {
3 display: none; /* Hide all containers by default */
4 }
5 
6 .button_style {
7 pointer-events: auto;
8 cursor: pointer; /* Ensure pointer cursor on hover */
9 }
10</style>
11 
12<script>
13document.addEventListener('DOMContentLoaded', function () {
14 // Select all buttons that have an ID starting with 'button'
15 const buttons = document.querySelectorAll('[id^=button]');
16 
17 // Add event listeners to each button
18 buttons.forEach(button => {
19 button.addEventListener('click', function () {
20 const postID = button.id.replace('button', ''); // Extract the post ID from the button ID
21 const containerID = 'container' + postID; // Construct the container ID
22 
23 // Hide all containers
24 document.querySelectorAll('.container').forEach(container => {
25 container.style.display = 'none';
26 });
27 
28 // Show the specific container related to the clicked button
29 const containerToShow = document.getElementById(containerID);
30 if (containerToShow) {
31 containerToShow.style.display = 'block';
32 }
33 });
34 });
35 
36 // Add event listener to each close icon
37 document.querySelectorAll('.close-icon').forEach(icon => {
38 icon.addEventListener('click', function () {
39 // Hide all containers when a close icon is clicked
40 document.querySelectorAll('.container').forEach(container => {
41 container.style.display = 'none';
42 });
43 });
44 });
45});
46</script>

0

Related Snippets

Please see some snippets below related to this snippet..

Elementor

Pro Verified

0

Default Panel Display

Added: 9 months ago

Last Updated: 9 months ago

By default, Elementor displays the widgets panel when the editor is loaded for the first time. You can change this.

Elementor

Pro Verified

0

Change the Elementor Interface Button Colour

Added: 1 year ago

Last Updated: 1 year ago

This is how you change the New Elementor Interface Button Colour to be whatever you want!

Elementor

AI Verified

0

Render ACF Pro Repeater Field as shortcode in Elementor

Added: 1 year ago

Last Updated: 1 year ago

Renders the Contents of an ACF Pro Repeater field as an HTML table using a simple shortcode.

Other Snippets in this Codevault

These are some popular snippets from this users codevault..

Performance

AI Verified

35

Remove Unused Javascript

Added: 2 years ago

Last Updated: 1 week ago

Remove Unused Javascript - and improve your Page Speed Insight Score

WooCommerce

Pro Verified

10

Deactivate some WooCommerce Checkout Fields

Added: 2 years ago

Last Updated: 2 months ago

Deactivate some WooCommerce Checkout Fields from showing

Elementor

AI Verified

6

CSS Grid Aid

Added: 9 months ago

Last Updated: 3 months ago

This can be used for any WordPress Builder to aid working with CSS Grids.