YuhangYang (Talk | contribs) |
|||
(7 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | /* | + | /*Lazy loading*/ |
$(function(){ | $(function(){ | ||
+ | |||
var winHeight=$(window).height(); | var winHeight=$(window).height(); | ||
− | + | var AbstractTop=$(".Content").offset().top-$(window).scrollTop(); | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | if(AbstractTop<winHeight-100){ | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | if( | + | |
setTimeout(function(){ | setTimeout(function(){ | ||
− | $(". | + | $(".Abstract").addClass("a-fadeinR"); |
− | $(". | + | $(".Abstract").css("display","block"); |
},150); | },150); | ||
} | } | ||
+ | |||
+ | var AbstractHeight=$(".Abstract").outerHeight(); | ||
+ | $(".Content").css("height",AbstractHeight); | ||
$(window).scroll(function(){ | $(window).scroll(function(){ | ||
winHeight=$(window).height(); | winHeight=$(window).height(); | ||
− | + | AbstractTop=$(".Content").offset().top-$(window).scrollTop(); | |
− | if( | + | if(AbstractTop<winHeight-100){ |
setTimeout(function(){ | setTimeout(function(){ | ||
− | $(". | + | $(".Abstract").addClass("a-fadeinR"); |
− | $(". | + | $(".Abstract").css("display","block"); |
},150); | },150); | ||
} | } |
Latest revision as of 10:53, 29 October 2017
/*Lazy loading*/ $(function(){
var winHeight=$(window).height(); var AbstractTop=$(".Content").offset().top-$(window).scrollTop();
if(AbstractTop<winHeight-100){ setTimeout(function(){ $(".Abstract").addClass("a-fadeinR"); $(".Abstract").css("display","block"); },150); }
var AbstractHeight=$(".Abstract").outerHeight(); $(".Content").css("height",AbstractHeight);
$(window).scroll(function(){
winHeight=$(window).height(); AbstractTop=$(".Content").offset().top-$(window).scrollTop();
if(AbstractTop<winHeight-100){ setTimeout(function(){ $(".Abstract").addClass("a-fadeinR"); $(".Abstract").css("display","block"); },150); }
});
});