JQuery wait for page to finish loading before starting the slideshow?

前端 未结 6 595
囚心锁ツ
囚心锁ツ 2020-12-16 16:31

I have a site with a rotating header image (you\'ve all seen them). I want to do the following:

  1. Load the entire page plus the first header image
  2. Start
6条回答
  •  失恋的感觉
    2020-12-16 16:57

    you can try

    $(function()
    {
    
    $(window).bind('load', function()
    {
    
    // INSERT YOUR CODE THAT WILL BE EXECUTED AFTER THE PAGE COMPLETELY LOADED...
    
    });
    });
    

    i had the same problem and this code worked for me. how it works for you too!

提交回复
热议问题