Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
12-19-2013, 01:59 PM #1
- Join Date
- Jun 2013
- Thanked 2 Times in 2 Posts
Display previous & Next image dynamicllay
Hi to everyone, i am trying to display a 5 image initially
Please give any suggestion regarding this or any better solution than this to display "previous" & "Next" images dynamically.
12-19-2013, 04:44 PM #2
- Join Date
- Jan 2011
- Thanked 931 Times in 928 Posts
This is a double post.
To set up in PHP you would have to make an array and populate it with all of your images. Maybe not the best approach.
Better would be to use ajax http://www.w3schools.com/ajax/. Have the JS keep track of what is currently displayed and send the info to PHP which will get the next set.
I don't store images in the database. I place them in a folder and store their addresses in the DB. If you make the image names sequential, like image_1.jpg and image_2.jpg, ETC. You could do it all in JS and just change the src of the img tag (s).
Last edited by sunfighter; 12-19-2013 at 04:48 PM.Evolution - The non-random survival of random variants.
Physics is actually atoms trying to understand themselves.