Skip to content
Advertisement

Modal within a php while loop EDIT: how to close modal

Okay so basically I have a modal that is within a while loop that is pulling in post data for a video link. The issue is that it only works for the first video and I understand that it’s because that is what loads first. I want to know how I can get it to work for all videos in the loop. Maybe using some type of data-src attribute? not sure.. any help would be great.

JavaScript

EDIT: I have made some changes and updates.. My question is slightly different now. Basically all i need to know now is how do I close the modal when user clicks outside of my modal?

JavaScript

Advertisement

Answer

Hello everyone I figured out my own issue. If you are interested here is the final script i ended up going with here took em HOURS to figure out….

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