Solved

Add Javascript to Cause JQuery Slideshow to Start at Random

Posted on 2014-04-16
4
750 Views
Last Modified: 2014-04-18
I am working on the following site:

http://domgarofalo.com/wellcity/

Under the section 'WHAT LEADERSHIP IS SAYING'
the pictures advance in alphabetical order. I would like
to modify the script so they start in random order each
time the page is loaded.

The script is located between lines 556-586.

Would I do this as an array?
0
Comment
Question by:domgarofalo
  • 2
  • 2
4 Comments
 
LVL 10

Accepted Solution

by:
Jeffrey Dake earned 500 total points
ID: 40005756
Looking at the docs of the library you are using you should be able to just start = random and the javascript library should already be able to pick a random picture to start with.

<script type="text/javascript">
$(window).load(function(){			
			$('#recent-projects').carouFredSel({
                                start: random,
				responsive: true,
				width: '100%',
				auto: true,
				circular	: true,
				infinite	: false,
				prev : {
					button		: "#car_prev",
					key			: "left",
						},
				next : {
					button		: "#car_next",
					key			: "right",
							},
				swipe: {
					onMouse: true,
					onTouch: true
					},
				scroll : 1500,
				items: {
					visible: {
						min: 1,
						max: 1
					}
				}
			});
		});	
</script>

Open in new window


http://docs.dev7studios.com/jquery-plugins/caroufredsel-advanced

Hope that helps
0
 

Author Comment

by:domgarofalo
ID: 40006929
Unfortunately it did not. It lists all the profiles vertically instead with no scrolling. Any other ideas?
0
 

Author Comment

by:domgarofalo
ID: 40006979
When added random here,

items: {
                              start: 'random',
                              visible: {
                                    min: 1,

it did the trick. Thanks for the help.
0
 
LVL 10

Expert Comment

by:Jeffrey Dake
ID: 40009995
Sorry I put it in the wrong spot. Glad it helped you out
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now