Jump to content

Recommended Posts

I want a simple image gallery setup where you click the image and the next one is shown... easy right. No modal boxes or anything, simply an imag on the page and when clicked, it switches to the next image in the div, maybe with a simple fade in / out.

 

There are many plugins that do this and it is not hard to code. The only problem is that my PHP page populates itself with a div for each lot of images and then of course the images inside using a foreach loop.

 

So what is the best way to have multiple js image galleries that behave independently from each other?

 

The divs and images are created using a loop so not sure of the best way other than setting up a function for each one separately but it seems like a bloated solution...

 

any ideas?

Link to comment
https://forums.phpfreaks.com/topic/225951-multiple-basic-galleries-on-one-page/
Share on other sites

So what is the best way to have multiple js image galleries that behave independently from each other?

 

Assuming I'm following what you're asking, an object would probably be the best way. Using an object you can have a separate instance of the gallery pointing to the correct set of images, or wrapper depending on how you do it.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.