Page 1 of 1

Displaying one image at a time

Posted: Tue Dec 02, 2003 11:24 am
by Mo
I want to display a few images on the screen - 1 at a time.

Meaning:
display the first image
wait one second
display the second image
wait one second
display the third image

Code: Select all

<?php
echo "<img src='image_1' width=320 height=240>";
flush(); sleep(1);

echo "<img src='image_2' width=320 height=240>";
flush(); sleep(1);

echo "<img src='image_3' width=320 height=240>";
flush(); sleep(1);
?>
I dont think this is the best way to do this. One thing I notice is the mouse hase the hourglass symbol, like the page is still loading.

Does anyone have any suggestions.

Re: Displaying one image at a time

Posted: Tue Dec 02, 2003 11:32 am
by Weirdan
Mo wrote: I dont think this is the best way to do this. One thing I notice is the mouse hase the hourglass symbol, like the page is still loading.

Does anyone have any suggestions.
Better way is to use JS. Preload desired images, then use settimeout function to change image source.

Posted: Tue Dec 02, 2003 12:32 pm
by Mo
I am not familioar with javascript. Could you give me an example?

Posted: Tue Dec 02, 2003 5:39 pm
by m3mn0n
http://www.hotscripts.com might have that code.

If not a [google]google[/google] search will most likely help ya.