Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Add Javascript to Cause JQuery Slideshow to Start at Random

Posted on 2014-04-16
4
Medium Priority
?
797 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 11

Accepted Solution

by:
Jeffrey Dake earned 2000 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 11

Expert Comment

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

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

How to build a simple, quick and effective accordion menu using just 15 lines of jQuery and 2 css classes
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
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…

604 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