Closed Thread
Thread Tools Search this Thread
Unread 11th Apr 2011, 05:21 PM   #1
Warrior Member
 
Join Date: 2011
Posts: 21
Thanks: 5
Thanked 0 Times in 0 Posts
Default
Need some Javascript help......
Share on: 
fb share twitter share gplus share more share

Hey!

I have a question and am hoping some of you expert Warriors can help me out. I'm doing some website maintenance for a company and need to modify some javascript- which I don't know much about.

The website has a serious of folders for different webpages called "mainPicture". The javascript that commands these folders is currently set up to display pics in a slideshow in alphabetical order. I need to figure out how to display pics randomly, so that they always show in a different order.

I've attached the javascript document that I'm pretty sure needs to be modified to accomplish this.

If anyone can give me some direction on this that would be awesome! Thanks so much!!!!

Rebecca
Attached Files
File Type: txt slideshow.txt (4.9 KB, 6 views)
zozja is offline  
Unread 12th Apr 2011, 03:37 AM   #2
Active Warrior
 
Join Date: 2010
Posts: 74
Thanks: 10
Thanked 11 Times in 11 Posts
Default
Re: Need some Javascript help......
Share on: 
fb share twitter share gplus share more share

Not really sure how to do it that code. I would put the file names into an array and shuffle them but that is not a very good solution.

Do you have to use that slider? I'm not sure whether it is really the same but the one on my website - Michael Burton | Home takes images inside a div that are in a list then displays them randomly. Refresh to the page a couple of times and you'll see what I mean. That slider is the nivo slider Nivo Slider - The Most Awesome jQuery Image Slider and it uses jquery.

If you definitely have to use what you have been given I can take a deeper look at it though.
burton247 is offline  
Unread 12th Apr 2011, 04:57 PM   #3
Warrior Member
 
Join Date: 2011
Posts: 21
Thanks: 5
Thanked 0 Times in 0 Posts
Default
Re: Need some Javascript help......
Share on: 
fb share twitter share gplus share more share

Hey! Thanks for the response... Yes, I do have to use the script that I attached or "slider" as you called it

Any ideas?

Thanks!

Originally Posted by burton247 View Post

Not really sure how to do it that code. I would put the file names into an array and shuffle them but that is not a very good solution.

Do you have to use that slider? I'm not sure whether it is really the same but the one on my website - Michael Burton | Home takes images inside a div that are in a list then displays them randomly. Refresh to the page a couple of times and you'll see what I mean. That slider is the nivo slider Nivo Slider - The Most Awesome jQuery Image Slider and it uses jquery.

If you definitely have to use what you have been given I can take a deeper look at it though.
zozja is offline  
Unread 14th Apr 2011, 09:12 AM   #4
Active Warrior
 
Join Date: 2010
Posts: 74
Thanks: 10
Thanked 11 Times in 11 Posts
Default
Re: Need some Javascript help......
Share on: 
fb share twitter share gplus share more share

Haven't really got time to take a proper look now. But you're reading the images in from somewhere. When you load them store them all in an array. Now you have access all all the images as you want them. If they want a random order each time the page is loaded then write a function that will randomise the array and then print them to screen as normal. If you need a different image each time it is sliding (so not in any sequence) then pull a random image to start with, then generate a new rand number and pull that element in as long as it is not equal to the one being currently displayed.

There is probably a better way of doing this but that is how I would do it having a quick think now. But I don't know javascript all that well.
burton247 is offline  
The Following User Says Thank You to burton247 For This Useful Post:
Closed Thread


Bookmarks

Tags
javascript

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




All times are GMT -6. The time now is 12:19 PM.