so i found this amazing jQuery slideshow called Skitter. it’s awesome! so i implemented it in my latest project.
i got it @ http://thiagosf.net/projects/jquery/skitter/#documentation
Is it possible to (and if so, how do I) have the images be randomly displayed BUT always start with a particular one?
For example, say I want the first image that it shows when a user loads the page is a particular one with a welcome message. But then for every image “after” that one, it’s randomized.
I have the “show_randomly: true,” part in the head and my current slide is randomizing successfully. I just hope to have a ‘start’ image.
So from its homepage, I did the “Customize Features” and copy/pasted the code it gave me into the head of my page…
<!-- CSS -->
<link type="text/css" href="scripts/SkitterSlideshow/css/skitter.styles.css"
media="all" rel="stylesheet" />
<!-- JS -->
<script type="text/javascript"
src="scripts/SkitterSlideshow/js/jquery-1.6.3.min.js"></script>
<script type="text/javascript"
src="scripts/SkitterSlideshow/js/jquery.easing.1.3.js"></script>
<script type="text/javascript"
src="scripts/SkitterSlideshow/js/jquery.animate-colors-min.js"></script>
<script type="text/javascript"
src="scripts/SkitterSlideshow/js/jquery.skitter.min.js"></script>
<!-- Init Plugin -->
<script>
$(document).ready(function() {
$(".box_skitter_large").skitter({
animation: "randomSmart",
dots: true,
preview: true,
controls_position: "center",
numbers_align: "right",
hideTools: true,
show_randomly: true,
controls: true,
interval: 5000,
velocity: 0.5,
});
});
</script>
So like i said, i have a successful slideshow running and it IS randomizing the images. Just need a way to have it always start with one particular image from the list.
THANKS!!!
To the best of my knowledge, that isn’t a functionality of the Skitter script. However, you can easily add it. Start by opening up the
jquery.skitter.jsfile (it will be hard to make changes to the .min.js file you’re using now, and you can always minimize it later on).Find the following line:
Immediately after that, add this:
Then, to declare an initial (start) image, simply add
[initial]to the beginning of the href attribute of the desired image. The following example will always start off with images/003.jpg, assuming you have show_randomly enabled in the script options.If you want to minimize this again, there are several Internet services, such as http://www.minifyjavascript.com, http://refresh-sf.com/yui, or http://jscompress.com.