Prevent user to perform any actions while page is loading

前端 未结 4 1702
小鲜肉
小鲜肉 2020-12-20 18:09

I have a tabbed web application, and I also created caching of the images before page transitions, so when the user goes to a page, I make sure all the images are downloaded

4条回答
  •  北荒
    北荒 (楼主)
    2020-12-20 18:21

    I use:

    $(window).bind('load', function() {
        // code here
    });
    

    Until the page is not completely loaded this event is not fired. So, there, you can call a function that unlock your page's elements.

    Enjoy :)

提交回复
热议问题