PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
Mo
Forum Newbie
Posts: 21 Joined: Thu Nov 06, 2003 7:21 am
Post
by Mo » Tue Dec 02, 2003 11:24 am
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.
Weirdan
Moderator
Posts: 5978 Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine
Post
by Weirdan » Tue Dec 02, 2003 11:32 am
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.
Mo
Forum Newbie
Posts: 21 Joined: Thu Nov 06, 2003 7:21 am
Post
by Mo » Tue Dec 02, 2003 12:32 pm
I am not familioar with javascript. Could you give me an example?
m3mn0n
PHP Evangelist
Posts: 3548 Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada
Post
by m3mn0n » Tue Dec 02, 2003 5:39 pm
http://www.hotscripts.com might have that code.
If not a [google]google[/google] search will most likely help ya.