YuhangYang (Talk | contribs) |
YuhangYang (Talk | contribs) |
||
Line 1: | Line 1: | ||
− | /* | + | /*Lazy loading*/ |
$(function(){ | $(function(){ | ||
− | $( | + | var winHeight=$(window).outerHeight(); |
− | + | var footerTop=$(".footer_box").offset().top-$(window).scrollTop(); | |
− | + | ||
− | + | if(footerTop<winHeight-100){ | |
− | + | setTimeout(function(){ | |
− | + | $(".footer").addClass("a-fadeinB"); | |
− | } | + | $(".footer").css("display","block"); |
+ | },150); | ||
+ | } | ||
− | $( | + | $(window).scroll(function(){ |
− | + | ||
− | $( | + | winHeight=$(window).outerHeight(); |
− | + | footerTop=$(".footer_box").offset().top-$(window).scrollTop(); | |
− | $(". | + | |
− | + | if(footerTop<winHeight-100){ | |
− | + | setTimeout(function(){ | |
− | + | $(".footer").addClass("a-fadeinB"); | |
− | + | $(".footer").css("display","block"); | |
− | + | },150); | |
− | + | } | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
}); | }); | ||
}); | }); |
Revision as of 07:54, 23 October 2017
/*Lazy loading*/ $(function(){
var winHeight=$(window).outerHeight(); var footerTop=$(".footer_box").offset().top-$(window).scrollTop();
if(footerTop<winHeight-100){ setTimeout(function(){ $(".footer").addClass("a-fadeinB"); $(".footer").css("display","block"); },150); }
$(window).scroll(function(){
winHeight=$(window).outerHeight(); footerTop=$(".footer_box").offset().top-$(window).scrollTop();
if(footerTop<winHeight-100){ setTimeout(function(){ $(".footer").addClass("a-fadeinB"); $(".footer").css("display","block"); },150); }
});
});