Well done on an awesome plugin!
Just one question though, we've been trying to cycle the items infinitely in the basic slider, but we've failed in everything we do.
We went through your documentation a few times and we could not find anything related to an infinite cycle.
Could you perhaps steer us in the right direction.
We were looking for an infinite loop on the same items.
But thank you for your reply, and thanks for an amazing plugin. It is by far the best I've worked with.
Try this code:
// first add to image list two duplicates to start and end
var first = $('li:first', $(#myframe));
var last = $('li:last', $(#myframe));
first.before(last.clone(true));
last.after(first.clone(true));
var sly = new Sly($(#myframe), {
/// init own SLY
startAt: 1,///first start from second item
pageBuilder:/// pageBuilder will return nonvisible first and last bullet.
function (index) {
var total = $('li', $(#myframe)).length;
if(index == total-1 || index == 0){
return '<li style="display: none;">' + (index + 1) + '</li>';
}else{
return '<li>' + (index + 1) + '</li>';
}
}).init();
// then make listener which replace last slide to second and first to prelast
sly.on('moveEnd' , function (eventName) {
var ty = sly.rel.activePage;
if(ty == 0 ||ty == sly.items.length-1){
var slided = 1;
if(ty == 0){
var slided = sly.items.length - 2 ;
}
var speed = sly.options.speed + '';
sly.options.speed = 0;
sly.activate(slided);
sly.options.speed = speed;
}
});