Solved

Add Javascript to Cause JQuery Slideshow to Start at Random

Posted on 2014-04-16
4
756 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
There are a couple ways to attach a JavaScript function to dynamically created elements. You can make a new script for each element as it’s created or you can use delegation. Delegation allows a single script that is added at page creation to mat…
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…

863 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

18 Experts available now in Live!

Get 1:1 Help Now