What jQuery event is called right after $(document).ready()?

前端 未结 8 901
囚心锁ツ
囚心锁ツ 2021-01-13 08:47

I have lots of HTML generated on $(document).ready(). I have a simple window system. But not only it is generated on $(document).ready() - also som

8条回答
  •  -上瘾入骨i
    2021-01-13 09:23

    If you want something to fire right after all $(document).ready() calls, you can put this once anywhere in your page:

    $(document).ready(function() {
        setTimeout(function() {
            // call your code here that you want to run after all $(document).ready() calls have run
        }, 1);
    });
    

    This will get called along with all the other document.ready calls, but it sets a short timeout that will execute after all the other document.ready calls have finished.

提交回复
热议问题