By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,481 Members | 1,211 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,481 IT Pros & Developers. It's quick & easy.

Slideshow Similar to Lightbox 2

P: 59
I'm attempting to create a slideshow with similar functionality as Lightbox 2.

I don't want anything to pop up like the Lightbox does, I just want the slideshow to have next/previous buttons (like in the Image Set example). Keeping the animation between transitions would be preferable, but it's not necessary. Can anyone help me?
Nov 3 '07 #1
Share this Question
Share on Google+
1 Reply


acoder
Expert Mod 15k+
P: 16,027
Store the image locations in an array.

Keep a global variable which has the current index pointer into the array - default 0.

Create next and previous which are called on clicking Next and Previous.

The next() function should advance the pointer by one and then change the src property of the image to the image location stored at that position in the array. Make a check against the length of the array to avoid errors. The previous() function is similar.
Nov 3 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.