jQuery and setTimeout

后端 未结 4 1669
粉色の甜心
粉色の甜心 2021-01-27 02:37

I have the following code:

            jQuery(document).ready(function()
            {
setTimeout($(\'#loading\').fadeIn(\'slow\'), 9999);
            });
         


        
4条回答
  •  清歌不尽
    2021-01-27 03:22

    The settimeout() function is from javascript and takes a function as an argument.

    Best choice would be to use jQuery's builtin delay() function:

     jQuery(document).ready(function()
     {
       $('#loading').delay(9999).fadeIn('slow');
     });
    

    More information/exemples: http://api.jquery.com/delay/

提交回复
热议问题