Dzień Dobry,
Bardzo chciałbym zrobic płynną animacje przesuwających się obrazków, która jest zapętlona, i cały czas płynnie się ort!.
Czy wie ktos moze jak można zatrzymać na chwile to ort! obrazków, w czasie najechania na selektor li?
Będę bardzo zobowiązany za jakąkolwiek pomoc.
var totalWidth = 0;
var numerOfChildlenElements = 0;
$(document).ready(function() {
numerOfChildlenElements = $("ul").children().length;
for(i = 0; i < numerOfChildlenElements; ++i)
totalWidth += $("ul").children().eq(i).width();
$('#horizontalSlider ul').css("width", totalWidth);
$("#left").click(function(e){
e.preventDefault();
moveLeft();
});
$("#right").click(function(e){
e.preventDefault();
moveRight();
});
moveRight();
//setInterval(function(){moveRight();}, 3000);
function moveRight() {
$('#horizontalSlider ul').animate({right: totalWidth}, 20000, function () {
//$('#slider ul li:first-child').appendTo('#slider ul');
//$('#slider ul').css('left', '');
});
}
});
Przykład znajduję sie w poniższym linku:
http://jsfiddle.net/xp1Lbhza/1/
Pozdrawiam,
MiP