From 80c7b9fe8d0ba88616ea47b2f8d32b7cc0fe76d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BD=97=E5=AE=AA?= Date: Tue, 9 Jun 2015 14:04:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9load=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E5=92=8Cfooter=E5=87=BA=E5=9C=BA=E7=9A=84=E5=BB=B6=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/home.js | 4 ++-- static/homeLoad.js | 50 ++++++++++++++++++++++------------------------ static/style.css | 8 ++++---- 3 files changed, 30 insertions(+), 32 deletions(-) diff --git a/static/home.js b/static/home.js index 2132907b81..3548d9b76b 100644 --- a/static/home.js +++ b/static/home.js @@ -269,6 +269,6 @@ $(function () { } } }; - bannerAnim.init() - + //bannerAnim.init() + window.bannerAnim=bannerAnim; }); diff --git a/static/homeLoad.js b/static/homeLoad.js index 6ab1f76497..4230fa6ad2 100644 --- a/static/homeLoad.js +++ b/static/homeLoad.js @@ -60,43 +60,41 @@ $(function () { self.load() }, load:function (){ - var self=this,lArr=[],num= 0,tNum=0; - function getJS(){ - for(var i=0;i=lArr.length){ - self.loadBox.addClass("load-out").one(animEndStr, function () { - self.loadBox.remove(); - $("").appendTo($("body")); - }); - }else{ - $("").appendTo($("body")); - } - tNum++; - self.loadBar.css("width",tNum/loadData.length*100+"%"); - } + var self=this,num= 0; + function endLoad(){ + self.loadBox.addClass("load-out").one(animEndStr, function () { + self.loadBox.remove(); + bannerAnim.init(); + }); } - for(var i=0;i= 0) { - lArr.push(str); - num++; - if (num >= loadData.length) { - setTimeout(getJS,500); - } + function getLoad(){ + var str=loadData[num]; + if(str.indexOf(".js")>=0){ + $.getScript(str,function (){ + num++; + self.loadBar.css("width",num/loadData.length*100+"%"); + if(num>=loadData.length){ + setTimeout(endLoad,300); + }else{ + getLoad(); + } + }) + }else{ var img = new Image(); img.onload = img.onerror = function () { num++; - tNum++; - self.loadBar.css("width",tNum/loadData.length*100+"%"); + self.loadBar.css("width",num/loadData.length*100+"%"); if (num >= loadData.length) { - setTimeout(getJS,500); + setTimeout(endLoad,300); + }else{ + getLoad(); } }; img.src = str; } } + getLoad(); } }; $().ready(function (){ diff --git a/static/style.css b/static/style.css index ce7d47ab57..6c3d1c8f6f 100644 --- a/static/style.css +++ b/static/style.css @@ -375,8 +375,8 @@ header { -webkit-transition: width .3s cubic-bezier(0.785, 0.135, 0.15, 0.86);; } .load-out { - -webkit-animation: alphaOut 1s cubic-bezier(0.6, -0.28, 0.735, 0.045); - animation: alphaOut 1s cubic-bezier(0.6, -0.28, 0.735, 0.045); + -webkit-animation: alphaOut .5s cubic-bezier(0.6, -0.28, 0.735, 0.045); + animation: alphaOut .5s cubic-bezier(0.6, -0.28, 0.735, 0.045); } .banner-box #bannerAnim .banner-line-absolute { @@ -1577,8 +1577,8 @@ footer ul li > a { } .index-page footer { - -webkit-animation: yBottomMatrix .5s ease-out 2s backwards; - animation: yBottomMatrix .5s ease-out 2s backwards; + -webkit-animation: yBottomMatrix .5s ease-out 1s backwards; + animation: yBottomMatrix .5s ease-out 1s backwards; } .index-page .logo {