簡體   English   中英

如何使用js setTimeout延遲此文本淡入淡出?

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM