Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Random Picture Alternation
Old 10-30-2005, 03:39 PM Random Picture Alternation
Novice Talker

Posts: 9
Trades: 0
Hey,
I have this script which displays a random image on every refresh, but is there anything I can do to make it change every few seconds. For example, I know if this were actionscript I could use the setInterval function...

This code i'm using
PHP Code:
<?

$total 
"3";

$file_type ".jpg";

$image_folder "/splash_imgs";

$start "1";

$random mt_rand($start$total);

$image_name $random $file_type;

echo 
$image_folder/$image_name\" alt=\"$image_name ";

?>
iisthesloth is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-30-2005, 04:03 PM
0beron's Avatar
Defies a Status

Posts: 1,832
Location: Somewhere else entirely
Trades: 0
You can't do this in PHP - PHP runs on the server so you have to refresh or request a new page to run a script again. I'd use javascript as my weapon of choice for this effect although I don't know enough of that to offer a solution. I could move this thread to the Javascript forum if you want?
__________________
UPDATE 0beron SET talkupation = talkupation + lots WHERE post = 'helpful';

Please login or register to view this content. Registration is FREE
(aka MSN handwriting for forums)
0beron is offline
Reply With Quote
View Public Profile Visit 0beron's homepage!
 
Old 10-30-2005, 04:39 PM
Novice Talker

Posts: 9
Trades: 0
Thanks, That would be great if you could move the thread...
iisthesloth is offline
Reply With Quote
View Public Profile
 
Old 10-31-2005, 12:52 PM
funkdaddu's Avatar
Web Design Snob

Posts: 635
Trades: 0
http://www.quirksmode.org/js/rotate.html
funkdaddu is offline
Reply With Quote
View Public Profile Visit funkdaddu's homepage!
 
Old 11-03-2005, 09:33 AM
steveharro's Avatar
Extreme Talker

Posts: 172
Trades: 0
Is this what your after:
Rotates a series of images on the page every few seconds. The images can easily be changed, and the script can be modified to rotate the images randomly or in order.
Random Image Rotator
__________________
Regards Steve

Please login or register to view this content. Registration is FREE
steveharro is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Random Picture Alternation
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.20272 seconds with 12 queries