html 预载

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了html 预载相关的知识,希望对你有一定的参考价值。

/* Preloader */

#preloader {
    position:fixed;
    top:0;
    left:0;
    right:0;
    bottom:0;
    background-color: #26333e; /* change if the mask should have another color then white */
    z-index:9999; /* makes sure it stays on top */
}

#status {
    width:200px;
    height:200px;
    position:absolute;
    left:50%; /* centers the loading animation horizontally one the screen */
    top:50%; /* centers the loading animation vertically one the screen */
    background-image:url(../img/status.gif); /* path to your loading animation */
    background-repeat:no-repeat;
    background-position:center;
    margin:-100px 0 0 -100px; /* is width and height divided by two */
}
jQuery(window).on('load', function() { // makes sure the whole site is loaded
    jQuery('#status').fadeOut(); // will first fade out the loading animation
    jQuery('#preloader').delay(350).fadeOut('slow'); // will fade out the white DIV that covers the website.
    jQuery('body').delay(350).css({'overflow':'visible'});
})
<!-- Preloader -->
  	<div id="preloader">
  	    <div id="status">&nbsp;</div>
  	</div>

以上是关于html 预载的主要内容,如果未能解决你的问题,请参考以下文章

网页预载API

text 预载

text 预载

javascript 预载

php 预载

预载机