show loading icon until the page is load?

前端 未结 7 1334
不知归路
不知归路 2020-11-29 19:42

I wanted to show a loading icon to users until the page elements are fully loaded. How can I do that with javascript and I want to do it with javascript, not jquery?

7条回答
  •  一生所求
    2020-11-29 20:40

    The easiest way to put the loader in the website.

    HTML:

    CSS:

    #loading {
    position: fixed;
    width: 100%;
    height: 100vh;
    background: #fff url('images/loader.gif') no-repeat center center;
    z-index: 9999;
    }
    

    JQUERY:

    
    

提交回复
热议问题