/*var path= "http://static.fzbm.com/bmcj/zmjstatic/images/"; var arr=[//path+ ' Img_01.png ', "http://static.fzbm.com/bmcj/zmjpc/images/header_bag.jpg", path+ ' img_02.png ', path+ ' img_03.png ', path+ ' img_04.png ', path+ ' I Mg_05.png ', path+ ' img_06.png ', path+ ' img_07.jpg ', path+ ' img_08.jpg ', path+ ' Img_09.png '];*/ //Store Pictures varf={}; //stores the number of images loaded successfully varImgarr=[]; $(". IMGBG "). each (function(i) {var_this=$ ( This); $( This). attr ("Data-cover", Arr[i]); F[i]=NewImage (); F[I].SRC=$( This). Data ("cover")); $ (f[i]). Load (function() {_this.css ({"Background-image": "url (" +_this.data (' cover ') + ")"}) Imgarr.push (F[i]); Hasend ()}); functionHasend () {if(Imgarr.length===$ (". IMGBG "). Length) {
The method init () is executed when the picture is loaded and completed; } }
jquery determines that the background picture is fully loaded.