jQuery whole HTML page load with spinner

前端 未结 4 712
旧时难觅i
旧时难觅i 2021-02-04 04:58

I am trying to something simple -- make a jQuery script that will wait to show the entire page, including all DIVs, text, and images. While the page is loading, instead of showi

4条回答
  •  长情又很酷
    2021-02-04 05:43

    I think the best way would be to have a 'cover' div which will cover the whole page whilst it loads. It would be opaque, and would contain your GIF.

    The following would then hide the div once the page has loaded:

    $(document).ready(function() {
      // Hide the 'cover' div
    });
    

    The following would make the div the size of the page:

    .div{
      height:100%;
      width:100%;
      overflow:hidden;
    }
    

提交回复
热议问题