Difference between revisions of "Team:SSTi-SZGD/js/Home"

Line 1: Line 1:
 
/*跟随窗口大小的高度*/
 
/*跟随窗口大小的高度*/
 
$(function(){
 
$(function(){
 +
 
var winHeight=$(window).height();
 
var winHeight=$(window).height();
 +
 
if(winHeight>=380){
 
if(winHeight>=380){
 
$(".SSTi-SZGD").css("height",winHeight);
 
$(".SSTi-SZGD").css("height",winHeight);
Line 11: Line 13:
 
$(".topic").css("top",winHeight*0.35);
 
$(".topic").css("top",winHeight*0.35);
 
}
 
}
 +
 
$(window).resize(function(){
 
$(window).resize(function(){
 +
 
winHeight=$(window).height();
 
winHeight=$(window).height();
 +
 
if(winHeight>=380){
 
if(winHeight>=380){
 
$(".SSTi-SZGD").css("height",winHeight);
 
$(".SSTi-SZGD").css("height",winHeight);
Line 21: Line 26:
 
$(".topic").css("top",winHeight*0.35);
 
$(".topic").css("top",winHeight*0.35);
 
}
 
}
 +
 
});
 
});
 +
 
});
 
});
  

Revision as of 02:34, 1 August 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 AbstractTop=$(".Content").offset().top-$(window).scrollTop();

if(AbstractTop<winHeight-100){ setTimeout(function(){ $(".Abstract").addClass("a-fadeinR"); $(".Abstract").css("display","block"); },150); }

$(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); }

});

});