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
Old 08-10-2008, 04:49 AM Agent Help
afridy's Avatar
Extreme Talker

Posts: 196
Trades: 0
Hai guys,

I am planning to do a Basic slide show. i have now 1000 images in my ftp folder with different different names.

Now i need to do a basic slide show which has buttons next, prevous, pause, resume etc.

Now i need to start the show using randam images selected between 1-1000 numbers.

so how to do that? is my below plan will work.

say, the slide interval is 5seconds, so i have plan to pick 1 image randamly on each interval. now say 55 selected, how to connet that number with the images in the ftp folder. since the images files have no key like thing?
afridy is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-10-2008, 05:57 AM Re: Agent Help
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,383
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
You are going to need to use serverside code to read the folder and build an array of filenames.
You could then generate this into a javascript array into the page, but, a thousand element array definition would add a substantial overhead to the page.

A better option would be to have the code that reads the folder for filenames generate a javascript variable with the file count for maximum random number, then use a client side random number generator along with a AJAX remote call to get the filename for the next image.
If the images are quite large, using two synchronised intervals would be recommended, one to preload the next image to be shown (maybe at 2 seconds) and one at 5 seconds to switch to the preloaded image.

You could take this a step further and queue up the images in an array using push() and shift() to create a shift register (LILO) of preloaded images, though that would potentially start to eat into client resource pretty quickly.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 08-10-2008, 06:10 AM Re: Agent Help
afridy's Avatar
Extreme Talker

Posts: 196
Trades: 0
ok christ,
excep ajx part i can undestand the other parts.
so the js with php will do the job right.
afridy is offline
Reply With Quote
View Public Profile
 
Old 08-10-2008, 06:22 AM Re: Agent Help
afridy's Avatar
Extreme Talker

Posts: 196
Trades: 0
deleted.

Last edited by afridy; 08-10-2008 at 06:54 AM..
afridy is offline
Reply With Quote
View Public Profile
 
Old 08-10-2008, 07:09 AM Re: Agent Help
firebladeiii's Avatar
Average Talker

Posts: 26
Trades: 0
mmmh chrishirst is ryte. Afridy! follow his approach.
Create JavaScript array with Image path using the server side script, then randomly choose from the array.

Why you should not eat a piece of Ajax?
__________________
Thats it !

Please login or register to view this content. Registration is FREE
firebladeiii is offline
Reply With Quote
View Public Profile
 
Old 08-10-2008, 07:10 AM Re: Agent Help
afridy's Avatar
Extreme Talker

Posts: 196
Trades: 0
thank fireblade,
hm, i should also start learning ajax.
afridy is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Agent Help
 

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.50620 seconds with 12 queries