[英]how to delay this text fade on with js setTimeout?
如何使用setTimeout延遲此事件(文本滑入框架)?
//fadeIn active slide
$($containerClass+' .swiper-slide:nth-child('+ (currentSlide + 1) +')').find('.content').children().each(function(i){
$(this).delay(i*90).animate({
'opacity' : 1,
'padding-top' : 0
},{ duration: 400, easing: 'easeOutQuad'});
});
我無法重新創建您的確切方案,所以我創建了一個jsfiddle來執行我認為您要的操作。
小提琴中使用的Javascript:
// Iterate over slides
$.each($(".slide"), function (i, o) {
// settimeout
setTimeout(function () {
$(o).animate({
left: "+=420"
}, 400, function () {
// Do something
});
}, i * 1000); // Increment the wait
});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.