[英]trying to make carousel animation slider
我正在嘗試制作一張輪播動畫,該動畫需要3張照片並將其滑動到左側並帶來3張新圖像,我認為我沒有朝正確的方向尋求幫助
這是小提琴鏈接: http : //jsfiddle.net/G5cKK/11/
setInterval(function () {
$('img:first').animate({
'left': -$('.box').width() + 'px'
},1000, function () {
$(this).remove().appendTo('.all')
});
}, 5000);
您可以設置寬度而不是位置的動畫:
JavaScript的
setInterval(function() {
var $img = $('img:first');
var $imgClone = $img.clone().width(0).appendTo('.all');
$img.animate({'width': 0},1000, function(){$img.remove()});
$imgClone.animate({'width': 65},1000);
}, 5000)
演示: http : //jsfiddle.net/G5cKK/12/
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.