Solved

Add Javascript to Cause JQuery Slideshow to Start at Random

Posted on 2014-04-16
4
764 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

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

Suggested Solutions

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…

749 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