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

 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
/*custom Project Effect*/
 
/*custom Project Effect*/
 
$(function(){
 
$(function(){
$(".header .nav .mainnav").eq(2).hover(function(){
+
$(".header .nav .mainnav").eq(1).hover(function(){
 
$(".header .nav .Project span").css("color","#FAEE0D");
 
$(".header .nav .Project span").css("color","#FAEE0D");
 
},function(){
 
},function(){
Line 8: Line 8:
 
});
 
});
  
/*Lazy loading*/
+
/*Follow the height of the window size*/
 
$(function(){
 
$(function(){
 
 
var winHeight=$(window).height();
+
var winHeight=$(window).outerHeight();
var Project_IntroductionTop=$(".Content").offset().top-$(window).scrollTop();
+
if(winHeight>=489){
+
$(".SSTi-SZGD").css("height",winHeight);
if(Project_IntroductionTop<winHeight-100){
+
}
setTimeout(function(){
+
else{
$(".Project_Introduction").addClass("a-bouncein");
+
$(".SSTi-SZGD").css("height","489px");
$(".Project_Introduction").css("display","block");
+
},150);
+
 
}
 
}
 
 
$(window).scroll(function(){
+
$(window).resize(function(){
+
winHeight=$(window).height();
+
Project_IntroductionTop=$(".Content").offset().top-$(window).scrollTop();
+
 
 
if(Project_IntroductionTop<winHeight-100){
+
winHeight=$(window).outerHeight();
setTimeout(function(){
+
if(winHeight>=489){
$(".Project_Introduction").addClass("a-bouncein");
+
$(".SSTi-SZGD").css("height",winHeight);
$(".Project_Introduction").css("display","block");
+
}else{
},150);
+
$(".SSTi-SZGD").css("height","489px");
 
}
 
}
 
 

Latest revision as of 08:09, 23 October 2017

/*custom Project Effect*/ $(function(){ $(".header .nav .mainnav").eq(1).hover(function(){ $(".header .nav .Project span").css("color","#FAEE0D"); },function(){ $(".header .nav .Project span").css("color","#FAEE0D"); }); });

/*Follow the height of the window size*/ $(function(){

var winHeight=$(window).outerHeight(); if(winHeight>=489){ $(".SSTi-SZGD").css("height",winHeight); } else{ $(".SSTi-SZGD").css("height","489px"); }

$(window).resize(function(){

winHeight=$(window).outerHeight(); if(winHeight>=489){ $(".SSTi-SZGD").css("height",winHeight); }else{ $(".SSTi-SZGD").css("height","489px"); }

});

});