Trying to get this custom pager to work for jQuery Cycle.
I want the pagerAnchorBuilder
to return a list
item every 5 images so later on I can turn the pager into it's own cycle.
Here's the code:
pagerAnchorBuilder: function(idx,slide){
var $slideCount = $('#ul-homecycle > li').length;
if ((idx==0) || (idx%5 === 0)){
return '<li><a href="javascript:setSlide('+ idx +')" class="transhover"><img src="../images/home/thumb_carousel' + idx + '.jpg" width="183" height="72" /></a></li>';
}
else{
return '<a href="javascript:setSlide('+ idx +')" class="transhover"><img src="../images/home/thumb_carousel' + idx + '.jpg" width="183" height="72" /></a>';
}
}
So in the end I want Cycle to return this:
<ul>
<li>
<a href="javascript:void(0);">derp</a>
<a href="javascript:void(0);">derp</a>
<a href="javascript:void(0);">derp</a>
<a href="javascript:void(0);">derp</a>
<a href="javascript:void(0);">derp</a>
</li>
<li>
<a href="javascript:void(0);">derp</a>
<a href="javascript:void(0);">derp</a>
<a href="javascript:void(0);">derp</a>
<a href="javascript:void(0);">derp</a>
<a href="javascript:void(0);">derp</a>
</li>
</ul>
Please disregard the setSlide(#)
and the class values from the HTML string return in the JS, I have that under control. I can't figure this out even after 2 hours of searching.
Thanks in advance!