Line 26: | Line 26: | ||
/*延时加载*/ | /*延时加载*/ | ||
$(function(){ | $(function(){ | ||
+ | |||
var winHeight=$(window).height(); | var winHeight=$(window).height(); | ||
− | |||
var footerTop=$(".footer_box").offset().top-$(window).scrollTop(); | var footerTop=$(".footer_box").offset().top-$(window).scrollTop(); | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
if(footerTop<winHeight-100){ | if(footerTop<winHeight-100){ | ||
setTimeout(function(){ | setTimeout(function(){ | ||
Line 41: | Line 36: | ||
},150); | },150); | ||
} | } | ||
+ | |||
$(window).scroll(function(){ | $(window).scroll(function(){ | ||
+ | |||
winHeight=$(window).height(); | winHeight=$(window).height(); | ||
− | |||
footerTop=$(".footer_box").offset().top-$(window).scrollTop(); | footerTop=$(".footer_box").offset().top-$(window).scrollTop(); | ||
− | if( | + | |
+ | if(footerTop<winHeight-100){ | ||
setTimeout(function(){ | setTimeout(function(){ | ||
− | $(". | + | $(".footer").addClass("a-fadein"); |
− | $(". | + | $(".footer").css("display","block"); |
},150); | },150); | ||
} | } | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
}); | }); | ||
+ | |||
}); | }); |
Revision as of 04:14, 31 July 2017
/*跟随窗口大小的高度*/ $(function(){ var winHeight=$(window).height(); if(winHeight>=380){ $(".SSTi-SZGD").css("height",winHeight); $(".topic").css("top",winHeight*0.35); } else{ winHeight=380; $(".SSTi-SZGD").css("height",winHeight); $(".topic").css("top",winHeight*0.35); } $(window).resize(function(){ winHeight=$(window).height(); if(winHeight>=380){ $(".SSTi-SZGD").css("height",winHeight); $(".topic").css("top",winHeight*0.35); }else{ winHeight=380; $(".SSTi-SZGD").css("height",winHeight); $(".topic").css("top",winHeight*0.35); } }); });
/*延时加载*/ $(function(){
var winHeight=$(window).height(); var footerTop=$(".footer_box").offset().top-$(window).scrollTop();
if(footerTop<winHeight-100){ setTimeout(function(){ $(".footer").addClass("a-fadein"); $(".footer").css("display","block"); },150); }
$(window).scroll(function(){
winHeight=$(window).height(); footerTop=$(".footer_box").offset().top-$(window).scrollTop();
if(footerTop<winHeight-100){ setTimeout(function(){ $(".footer").addClass("a-fadein"); $(".footer").css("display","block"); },150); }
});
});