I am currently working on a site that uses jorgousel Sorgilla jquery, there are two sliders that work 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 wonder if it is possible to add external controls with the customization I use. Unfortunately, I'm brand new to jquery, so still learning.
What I need to do is add buttons under the carousel that behave like pagination, here is an example ... http://truelogic.org/multicarousel.php or http://www.skyports.com
here is the site running http://hartyinternational.hailstormcommerce.com/
Ideally, if I could use these buttons to paginate similar to the ones above, that would be great.
I have this css configured under 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 thinking about adding this code to a function inside initCallback: but I donโt know how to make it work or how to say which button represents which 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 I'm not sure where to start Thanks.