I’m totally new to JS but not to programming.
What I’m building right now is a web page that makes videos for local business and also hosts them on my site.
For each business I would like to have 2-5 images that can be clicked on to cause a pop-up of the full-sized image to appear, and have that pop-up close when you click on the image.
Now I know I could go through and program this for each business’s sub-page, but I was hoping there would be some way I could have one script that runs and changes based on each site because I have about 30 business that all need pop-up galleries.
I have a flowchart in mind and I was wondering if this is possible in JS:
1. User goes to business’s page
2. User clicks on thumb_image01.jpg thumbnail
3. JS creates a pop-up based off of the image’s name
a. I don’t know if this is possible in JS. It would need to create a page (not link to a page) based off of the thumbnail’s name to connect it to the full-sized version of the image (something like thumb_image01.jpg versus full_image01.jpg)
4. Close the pop-up window when the user clicks on the image or a “Close this Window” link
In short, I am wondering if it is possible to create reusable code that is dynamic in that I can stick the thumbnail image on the page and have JS find the full image based on the name and then display it in a pop-up.