pre-load a webpage before viewing

时间:2016-02-03 04:07:15

标签: html image-preloader

I have a Wordpress site that has numerous large images (full screen background image scroller) and when I go to my page it goes 'pixel-ly' and looks broken until fully loaded.

What is the proper procedure to load a websites images so the users first look at the site isn't broken or glitched?

2 个答案:

答案 0 :(得分:0)

Hide everything until the page is loaded. Show a loading screen in the meantime if you want.

<body onload="document.getElementById('loading').style.display = 'none';document.getElementById('content').style.display = 'block';">

<div id="loading">Some loading text or icon goes here...</div>

<div id="content" style="display:none;">Main content goes here...</div>

答案 1 :(得分:0)

Block page from user interaction until all images/components are loaded. It isn't too complex - use jQuery. it is already answered in

prevent user to perform any actions while page is loading