I've got a gallery setup with jquery cycle and jcarousel. I generate thumbnails with php
<ul id="pager">
<?php foreach ($thumbs as $thumb) : ?>
<li><a href="#"><?php echo $thumb ?> </a></li>
<?php endforeach; ?>
</ul>
Now I create a carousel and append the pager to cycle
$('#pager').jcarousel({});
if ( $('#images').length > 0 ) {
$('#images').before('<ul id="nav">').cycle({
fx: 'turnDown',
speed: 500,
timeout: 5000,
pagerEvent: 'mouseover',
pager: '#pager',
pagerAnchorBuilder: function(idx, slide) {
return '#pager li:eq(' + idx + ') a';
} ,
after: function(dir, id, el) {
var w= $('.jcarousel-clip-horizontal').width();
var i = $('.jcarousel-item-horizontal').width();
var slide = $('#pager .activeSlide');
if ( slide.position.left > w-i ) {
$('div.jcarousel-next').trigger('click');
}
}
});
$('#pager a').mouseenter(function() {
$('#images').cycle('toggle');
}).mouseleave(function(){
$('#images').cycle('toggle');
});
I got 7 elements in my pager visible and I want to trigger the scroll event for the next item thats not visible.
I tried to add an counter for the activeSlider using the jquery index() function but it got messy when hovering over pager item with the cursor.
Any advise on this.