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

Line 4: Line 4:
 
var winHeight=$(window).height();
 
var winHeight=$(window).height();
 
 
if(winHeight>=380){
+
if(winHeight>=465){
 
$(".SSTi-SZGD").css("height",winHeight);
 
$(".SSTi-SZGD").css("height",winHeight);
 
$(".topic").css("top",winHeight*0.35);
 
$(".topic").css("top",winHeight*0.35);
 
}
 
}
 
else{
 
else{
winHeight=380;
+
winHeight=465;
 
$(".SSTi-SZGD").css("height",winHeight);
 
$(".SSTi-SZGD").css("height",winHeight);
 
$(".topic").css("top",winHeight*0.35);
 
$(".topic").css("top",winHeight*0.35);
Line 18: Line 18:
 
winHeight=$(window).height();
 
winHeight=$(window).height();
 
 
if(winHeight>=380){
+
if(winHeight>=465){
 
$(".SSTi-SZGD").css("height",winHeight);
 
$(".SSTi-SZGD").css("height",winHeight);
 
$(".topic").css("top",winHeight*0.35);
 
$(".topic").css("top",winHeight*0.35);
 
}else{
 
}else{
winHeight=380;
+
winHeight=465;
 
$(".SSTi-SZGD").css("height",winHeight);
 
$(".SSTi-SZGD").css("height",winHeight);
 
$(".topic").css("top",winHeight*0.35);
 
$(".topic").css("top",winHeight*0.35);
 
}
 
}
 +
 +
var AbstractHeight=$(".Abstract").outerHeight();
 +
$(".Content").css("height",AbstractHeight);
 
 
 
});
 
});
Line 36: Line 39:
 
var winHeight=$(window).height();
 
var winHeight=$(window).height();
 
var AbstractTop=$(".Content").offset().top-$(window).scrollTop();
 
var AbstractTop=$(".Content").offset().top-$(window).scrollTop();
+
 
 
if(AbstractTop<winHeight-100){
 
if(AbstractTop<winHeight-100){
 
setTimeout(function(){
 
setTimeout(function(){
Line 43: Line 46:
 
},150);
 
},150);
 
}
 
}
 +
 +
var AbstractHeight=$(".Abstract").outerHeight();
 +
$(".Content").css("height",AbstractHeight);
 
 
 
$(window).scroll(function(){
 
$(window).scroll(function(){

Revision as of 06:53, 31 August 2017

/*跟随窗口大小的高度*/ $(function(){

var winHeight=$(window).height();

if(winHeight>=465){ $(".SSTi-SZGD").css("height",winHeight); $(".topic").css("top",winHeight*0.35); } else{ winHeight=465; $(".SSTi-SZGD").css("height",winHeight); $(".topic").css("top",winHeight*0.35); }

$(window).resize(function(){

winHeight=$(window).height();

if(winHeight>=465){ $(".SSTi-SZGD").css("height",winHeight); $(".topic").css("top",winHeight*0.35); }else{ winHeight=465; $(".SSTi-SZGD").css("height",winHeight); $(".topic").css("top",winHeight*0.35); }

var AbstractHeight=$(".Abstract").outerHeight(); $(".Content").css("height",AbstractHeight);

});

});

/*延时加载*/ $(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); }

});

});