Jump to content

making next page dynamic


zthemonkey

Recommended Posts

Hello allI am trying to make sort of a photo album thing and I was wondering if there is a way to make the links dynamic in the sense that if I added another picture I wouldnt have to go to the past page and change things. I dont know if that is clear or not. Any help would be greatly appreciated. Thanks in advance.Z

Link to comment
Share on other sites

there is a way. its called php. theres is a php gallery software, and all you have to do is upload pictures, and then they apear on a page.although i'm not an expert on these things..so i dont know how or where to get it from.

Link to comment
Share on other sites

Try placing all your pictures on the same page, and using Javascript, give them a display of 'none', except the first one.

document.getElementById('idOfSecondImage').style.display = 'none';document.getElementById('idOfThirdImage').style.display = 'none';etc

It is important to you use Javascript and not CSS for this because that way users without Javascript will be able to see all your pics anyway.Then make it so that when you click on the "next" link it makes the first pic disappear, and the next appear.

<a href="#idOfSecondImage" onclick="return next('idOfFirstImage','idOfSecondImage')" onkeypress="return next('idOfFirstImage','idOfSecondImage')">Next</a>

Javascipt:

next(1,2) {   document.getElementById(1).style.display = 'none';   document.getElementById(2).style.display = 'block';   return false;}

(take a look at the DHTML tutorials for more info)You will also need to change the values of 'href', 'onclick' and 'onkeypress' when calling the function, so that idOfFirstImage becomes idOfSecondImage, idOfSecondImage becomes idOfThirdImage, etc.I am not sure if you fully understood everything, it's quite complicated. =/ But that's a way to make it so that all your pictures starts loading in the same page, and therefore when you click to see the next picture, it appears right way.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...