提交 80c7b9fe 编写于 作者: 罗宪

修改load时间和footer出场的延时

上级 4af16c95
......@@ -269,6 +269,6 @@ $(function () {
}
}
};
bannerAnim.init()
//bannerAnim.init()
window.bannerAnim=bannerAnim;
});
......@@ -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;i++){
var str=lArr[i];
if(tNum>=lArr.length){
self.loadBox.addClass("load-out").one(animEndStr, function () {
self.loadBox.remove();
$("<script src=" + str + "></script>").appendTo($("body"));
});
}else{
$("<script src=" + str + "></script>").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<loadData.length;i++){
var str=loadData[i];
if (str.indexOf(".js") >= 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 (){
......
......@@ -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 {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册