justAnoob Posted November 9, 2010 Share Posted November 9, 2010 I have a page on my site which displays a picture that I have stored on my server. The loaction of that picture is stored in mysql. All the images are .jpg format. My question is, if I allow a user to upload 5 pictures instead of just 1, is there a simple script that would show each picture for about 2-3 seconds, the go to the next? Basically like an auto slideshow. Each picture has an ID that associates with the name of the category, so I could just call that ID and have the slideshow only show those pictures. So I'm just wondering about the slideshow script. Quote Link to comment https://forums.phpfreaks.com/topic/218233-simple-slideshow-for-phpmysql/ Share on other sites More sharing options...
ManiacDan Posted November 9, 2010 Share Posted November 9, 2010 Build a list of the pictures in order. Figure out what the current picture is. Figure out what the next picture should be. Set a javascript timeout to visit the next picture's URL after a few seconds. Profit. Quote Link to comment https://forums.phpfreaks.com/topic/218233-simple-slideshow-for-phpmysql/#findComment-1132397 Share on other sites More sharing options...
justAnoob Posted November 9, 2010 Author Share Posted November 9, 2010 So there would be a page refresh for each picture ? Quote Link to comment https://forums.phpfreaks.com/topic/218233-simple-slideshow-for-phpmysql/#findComment-1132402 Share on other sites More sharing options...
ManiacDan Posted November 9, 2010 Share Posted November 9, 2010 Doing it the easy way, yes. You can obviously load the images in the background in javascript, but that's significantly harder. You could also simply print all the images to the screen and make all but the first one "display: none;" Every 2 seconds, adjust the display of the items to display the next one. There's a hundred ways to do this. -Dan Quote Link to comment https://forums.phpfreaks.com/topic/218233-simple-slideshow-for-phpmysql/#findComment-1132405 Share on other sites More sharing options...
justAnoob Posted November 9, 2010 Author Share Posted November 9, 2010 Thanks ManiacDan, I guess I'll search for some javascipt tutorials on time limits then right? Thanks for the help.. Quote Link to comment https://forums.phpfreaks.com/topic/218233-simple-slideshow-for-phpmysql/#findComment-1132410 Share on other sites More sharing options...
ManiacDan Posted November 9, 2010 Share Posted November 9, 2010 The javascript function you want is called setTimeout(). Quote Link to comment https://forums.phpfreaks.com/topic/218233-simple-slideshow-for-phpmysql/#findComment-1132414 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.