Welcome Loading … Page with Jquery

前端 未结 5 1554
北荒
北荒 2021-01-03 03:23

How can I implement a welcome screen for 5 seconds giving information like Loading application ... + some application infos...while the main page loads in background.

5条回答
  •  离开以前
    2021-01-03 03:30

    Although I agree with @TheTXI, the best way to do it is to have the "loading..." screen visible by default using CSS, and then hide it once everything is loaded using jQuery (instead of waiting for a fixed amount of time).

    See jQuery.load()... ex:

      $(document).ready(function(){
        $("body img:last").load($("#welcome-screen").fadeOut());
      });
    

提交回复
热议问题