brad_langdon Posted January 28, 2011 Share Posted January 28, 2011 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? Quote Link to comment https://forums.phpfreaks.com/topic/225951-multiple-basic-galleries-on-one-page/ Share on other sites More sharing options...
Adam Posted January 28, 2011 Share Posted January 28, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/225951-multiple-basic-galleries-on-one-page/#findComment-1166613 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.