Jquery delay execution of script

前端 未结 2 536
故里飘歌
故里飘歌 2020-12-01 23:13

Having the following:

$(\'#navMain .nav1\').hover(function () {
    $(this).addClass(\'hover\');
    if ($.browser.msie && $.browser.version < 7)          


        
2条回答
  •  南方客
    南方客 (楼主)
    2020-12-01 23:45

    If a simple javascript delay can help you, you can do as follow:

    setTimeout(function() {
      // your code here
    }, 3000);
    

    With the following signature: setTimout(functionToExecute, delayInMs);

    and the documentation: http://www.w3schools.com/js/js_timing.asp

    Hopping I help you.

提交回复
热议问题