User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 427,428 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,533 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 1089 | Replies: 2
Reply
Join Date: Jul 2006
Posts: 16
Reputation: vov4ik is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
vov4ik vov4ik is offline Offline
Newbie Poster

Program-contolled delay

  #1  
Jul 20th, 2006
I want to create a slideshow of images. Image files will be uploaded from harddisk to the browser and change each other at specified duration.
How can i generate delay (after which the next image will be uploaded ) ?
Thank you in advance
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Sep 2005
Posts: 689
Reputation: digital-ether has a spectacular aura about digital-ether has a spectacular aura about 
Rep Power: 6
Solved Threads: 41
Moderator
digital-ether's Avatar
digital-ether digital-ether is offline Offline
Practically a Master Poster

Re: Program-contolled delay

  #2  
Jul 20th, 2006
This would involve javascript rather than php.

What you would have to do is use JavaScript to first preload the images, so that there is not delay when the image slides to the next.
This is done by attaching an onload event handler to the window object.
IE: window.onload = function() { /* js preload images goes here */ };

Switching through images is a simple matter. Changing the source of an image will make the browser load a new image in replacement of the old one.
IE: img.src = 'http://example.com/images/newimage.gif";

Maybe the JS forum would help or you can try google for "JavaScript Image Slideshow" or something similar.
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Reply With Quote  
Join Date: Jul 2004
Location: North East Indiana
Posts: 491
Reputation: Puckdropper is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 20
Puckdropper Puckdropper is offline Offline
Posting Pro in Training

Re: Program-contolled delay

  #3  
Jul 20th, 2006
You could do an annoyingly crude version in PHP using header commands. Tell the browser to refresh every x seconds (I think it's header(refresh: 10, http://www.yoursite.com)) and on each refresh change the reference URL.

This reloads the whole page rather than just the image, so a client-side language like JS is probably your best bet.
www.uncreativelabs.net

Old computers are getting to be a lost art. Here at Uncreative Labs, we still enjoy using the old computers. Sometimes we want to see how far a particular system can go, other times we use a stock system to remind ourselves of what we once had.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 5:22 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC