Hiding everything until the page has finished loading

后端 未结 8 1483
滥情空心
滥情空心 2020-12-19 06:33

I am looking to have everything on my page hidden until the page has finished loading. I have seen many posts and tried different things. The most common solution which work

8条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-19 06:55

    I would do the following

    
    
    
    
        
        
        
    
    
    
        this is the body...
    
    
    
        
    
    
    

    So hide it in inline CSS in the header (so it will take immediate effect and not suffer the latency of fetching an external file), then revel it in Javascript. Note: this isn't best practice with inline CSS and JS, but should give you the lowest latency and therefore not have a flash of visibility.

提交回复
热议问题