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

Line 2: Line 2:
 
$(function(){
 
$(function(){
 
var winHeight=$(window).height();
 
var winHeight=$(window).height();
$(".SSTi-SZGD").css("height",winHeight);  
+
if(winHeight>=380){
 +
$(".SSTi-SZGD").css("height",winHeight);
 +
$(".topic").css("top",winHeight*0.35);
 +
}
 
$(window).resize(function(){
 
$(window).resize(function(){
 
winHeight = $(window).height();
 
winHeight = $(window).height();
$(".SSTi-SZGD").css("height",winHeight);
+
if(winHeight>=380){
 +
$(".SSTi-SZGD").css("height",winHeight);
 +
$(".topic").css("top",winHeight*0.35);
 +
}
 
});
 
});
 
});
 
});

Revision as of 05:12, 25 July 2017

/*跟随窗口大小的高度*/ $(function(){ var winHeight=$(window).height(); if(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); } }); });