For example: http://www.weather.com/
When you first open it, it looks like this:
The specific content will then be displayed.
Please tell me, what technology is used for such a web page?
認(rèn)證0級講師
It doesn’t matter if it is used here angular
原理是把頁面分為不同 directive
,一開始雖然沒有具體內(nèi)容,但 directive
起到了占位符的作用,所以能看到頁面框架。directive
本身再通過 ajax
,向后臺(tái)請求具體內(nèi)容片斷,填充進(jìn)頁面框架里,顯示具體文本、圖片。
只要理解了原理,要實(shí)現(xiàn)這個(gè)效果本身很簡單,最后用不用 angular
There should be nothing surprising, because during the loading process of this website, the background image has not been loaded when the html and css are loaded. After a while, the background image is loaded and the effect of the entire website is displayed. Take a look at the network of f12. Got it
This is the first one to load
This is the last picture that has been loaded
My internet speed is a bit slow and it takes 1.15 seconds to load the background image
I think putting the js file under the body will have this effect
Let me talk about my personal opinions, for reference only:
I think this effect can be achieved through ajax.
First make the skeleton with html+css
Then js:
window.onload=function(){
當(dāng)頁面骨架顯示完整后,這里再發(fā)起ajax請求,載入數(shù)據(jù)
}