Run Function After Delay

前端 未结 4 850
青春惊慌失措
青春惊慌失措 2021-01-30 01:57

I have the below global jQuery function stored, but on page load, I want to execute it after a 1000 delay. Is there something wrong with my syntax? I know the delay always goes

4条回答
  •  醉话见心
    2021-01-30 02:51

    $(document).ready(function() {
    
      // place this within dom ready function
      function showpanel() {     
        $(".navigation").hide();
        $(".page").children(".panel").fadeIn(1000);
     }
    
     // use setTimeout() to execute
     setTimeout(showpanel, 1000)
    
    });
    

    For more see here

提交回复
热议问题