Skip to content
Advertisement

How to make a popup open for an individual slide rather than all of them at the same time on click?

Using php I have created several popups, that I want to appear once the button of any slide is clicked. The modal (simplified) looks something like this

JavaScript

After that there are the different product slides generated

JavaScript

After this I run a simple script that on button click displays the modal

JavaScript

This part works, and on click the modal appears, however, my issue is that all of the modals appear at the same time. Is there a way to make it so that only the modal that is tied to a specific product appears when its button is clicked, rather than all of them?

Thanks a lot!

Advertisement

Answer

FIrst need to create link between popup and button as follows

JavaScript

and now you can have link to button and popup

JavaScript

Hope this will help

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement