I looking-for tutorial about jQuery slider (like scrollable plugin) with cycle animation. Without any plugin, the simplest way, tutorial
UPDATED: 27/08/2014
$(function() {
/* author: Luca Filosofi * contact: [email protected] * http://devilmaycode.it * license: Public * Updated: 27/08/2014 */
var animating = false, iXS = 3, $slider = $('.panel-inner'), liW = $slider.find('li:first').width(), liFW = (liW * $slider.find('li').length);
$slider.width(liFW);
$('.button a').on('click', function(e) {
e.preventDefault();
if(!animating){
var left = Math.abs(parseInt($slider.css('left')));
var side = ($(this).data('direction') == 'right') ? (((left + (liW * iXS)) >= liFW) ? 0 : -(left + liW)) : ((left > 0) ? -(left - liW) : -(liFW - (liW * iXS)));
rotate(side);
}
});
var rotate = function(leftY) {
if(!animating){
animating = true;
$slider.stop(true, true).animate({left : leftY}, 500, function(){animating = false;});
}
}
});