I am currently working on a site,that uses Sorgilla jquery jcarousel, there are two sliders working together.
var carousel_2;
jQuery(document).ready(function() {
jQuery('#right-carousel').jcarousel({
start: 1, // Configuration goes here
wrap: "circular",
scroll: 1,
auto:3,
vertical:true,
itemFirstInCallback: {
onBeforeAnimation: function(carousel, item, index, action) {
if (carousel_2) {
carousel_2[action]();
}
}
}
});
});
jQuery(document).ready(function() {
jQuery('#mycarousel').jcarousel({
start: 3, // Configuration goes here
wrap: "circular",
scroll: 1,
auto:3,
vertical:false,
buttonNextHTML: null,
buttonPrevHTML: null,
initCallback: function(c) {
carousel_2 = c;
}
});
});
This works as it should but I am wondering is it possible to add external controls with the set up I am using. Unfortunately Im quite new to jquery so still learning.
What Im looking to do is add buttons underneath the carousel that behave like pagination, here is an example…
http://truelogic.org/multicarousel.php
or http://www.skyports.com
here is the site im working on
http://hartyinternational.hailstormcommerce.com/
Ideally if I could get those pagination buttons working similar to above, itd be great.
I have this css set up underneath the carousel.
.jcarousel-pagination {
width:100px;
height:40px;
position:absolute;
right:100px;
bottom:0px;
background:#000;
}
.jcarousel-pagination a {
font-size: 75%;
text-decoration: none;
padding: 0 5px;
margin: 0 0 5px 0;
border: 1px solid #fff;
color: #eee;
background-color: #4088b8;
font-weight: bold;
}
Here is some documentation… http://sorgalla.com/projects/jcarousel/
I was considering adding this code to the function inside initCallback: but unsure how to get it working or how to tell it what button represents what slide…
jQuery('.jcarousel-pagination a').bind('click', function() {
carousel.scroll(jQuery.jcarousel.intval(jQuery(this).text()));
return false;
});
Any help would be great, I know its a bit of a general question, but im not sure where to start
Thank you.
Copy/Paste the below code on a temp web page, make sure that the page the Javascript points to your folder where they are located and this should work.