<script>functionloading () {functionLoad () {} Load.prototype.loadImgs=function(URLs, callback) { This. URLs =URLs; This. Imgnumbers =urls.length; This. loadimgnumbers = 0; varthat = This; for(vari = 0; i < urls.length; i++) { varobj =NewImage (); OBJ.SRC=Urls[i]; Obj.onload=function() {that.loadimgnumbers++; Callback (parseint (That.loadimgnumbers/that.imgnumbers) * 100)); } } }; varLoader =NewLoad (); Loader.loadimgs ([//Write all picture addresses that need to be loaded here"Img/about1.jpg", "Img/about2.jpg", ], function(percent) {//assume that the element showing percentages is $ (". Percent")$ (". Percent"). Text (percent + '% ')); //hide the corresponding loading or matte after loading is complete if(Percent = = 100) { $(". Mask"). CSS (' Display ', ' none ')); } }); } //Execute the Loading methodloading (); </script>
Pre-load animations, percent animations that are commonly used by the mobile side before loading