JQuery wait x seconds after document ready

前端 未结 4 798
一个人的身影
一个人的身影 2020-12-05 09:33

following code waits till dom ready

jQuery(document).ready(function(){

what do i have to write to simple let the execution of the jquery fu

4条回答
  •  既然无缘
    2020-12-05 09:52

    Wrap your existing function with a call to setTimeout, ie, replace your current:

    jQuery(document).ready(function() {
         ....
    });
    

    with

    jQuery(document).ready(function() {
        setTimeout(function() {
             ....
        }, 2000);
    });
    

提交回复
热议问题