Newbie variable question

D

Darren

Hi All,

I'm trying to create a photo gallery. I have created the page and
placed the image (photo) in the center. Underneith it I have a list of
numbered links that display other images by using an image swap
script. That all works fine.

What I cannot work out, is how I can make 'previous' and 'next' photo
links work. I do not want to re-load the page each time or else it
would defeat the purpose of using the image swap. It would work though
:) I'd just use a QueryString or something.

I was thinking of using a variable... but I'm just not that good with
javascript. :(

What I had in mind is:

When the page is loaded the variable 'PhotoNumber' equals '1'

If the user clicks on link '3' under the photo the variable
PhotoNumber will need to change to 3, aswell as run the onClick image
swap event.

If the user clicks on the 'next' link the OnClick event will need to
know what the current photonumber is and add 1. Ie PhotoNumber =
PhotoNumber + 1. It will also need to change the PhotoNumber variable
and call the image swap.

Hope that makes sense, I'm still a newbie and can't javascript very
well. Any ideas would be appreciated. :)

Thanks in advance,
Darren Stahlhut
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,813
Messages
2,569,699
Members
45,489
Latest member
SwethaJ

Latest Threads

Top