如何给下面的js设置延迟触发?


<script>
//移入
function tplBoxMoveUp(e){


    $(e).find('img').css({transition:'0s'});
    var t = $(e).height(),
        i = $(e).find("img").height(),
        n = i - t;
    var time = n/i;
    times = (10*time).toFixed(1);  
    n > 0 && $(e).find("img").css({ transform: "translateY(-" + n + "px)",transition:times+"s" })  
}
//移出
function tplBoxMoveDown(e){


    var t = $(e).height(),
        i = $(e).find("img").height(),
        n = i - t;
    var ot = n/i;
    ots = (8*ot).toFixed(1);
    $(e).find("img").css({transform:"translateY(0px)",transition:ots+'s'})
}
</script>

需要延迟触发的分别是 tplBoxMoveUp(e) 和 tplBoxMoveDown(e) 内的代码,比如说延迟10秒左右。请问这个应该怎么写?因没学过这块还请麻烦给写出来谢谢。


setTimeout(function(){
tplBoxMoveUp(e);
}, 10000);

你是想先执行哪个,两个一起执行,还是先执行一个,在执行另一个

定时器 可以