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

Line 1: Line 1:
/*nav*/
+
/*Lazy loading*/
 
$(function(){
 
$(function(){
 
 
$(".header .nav .mainnav").eq(1).hover(function(){
+
var winHeight=$(window).outerHeight();
$(".header .nav .Project span").css("color","#FAEE0D");
+
var footerTop=$(".footer_box").offset().top-$(window).scrollTop();
$(".header .nav .Project .unify").stop().slideDown();
+
 
},function(){
+
if(footerTop<winHeight-100){
$(".header .nav .Project span").css("color","#fff");
+
setTimeout(function(){
$(".header .nav .Project .unify").stop().slideUp();
+
$(".footer").addClass("a-fadeinB");
});
+
$(".footer").css("display","block");
 +
},150);
 +
}
 
 
$(".header .nav .mainnav").eq(2).hover(function(){
+
$(window).scroll(function(){
$(".header .nav .Application span").css("color","#FAEE0D");
+
$(".header .nav .Application .unify").stop().slideDown();
+
winHeight=$(window).outerHeight();
},function(){
+
footerTop=$(".footer_box").offset().top-$(window).scrollTop();
$(".header .nav .Application span").css("color","#fff");
+
$(".header .nav .Application .unify").stop().slideUp();
+
if(footerTop<winHeight-100){
});
+
setTimeout(function(){
+
$(".footer").addClass("a-fadeinB");
$(".header .nav .mainnav").eq(3).hover(function(){
+
$(".footer").css("display","block");
$(".header .nav .Human_Practices span").css("color","#FAEE0D");
+
},150);
$(".header .nav .Human_Practices .unify").stop().slideDown();
+
}
},function(){
+
$(".header .nav .Human_Practices span").css("color","#fff");
+
$(".header .nav .Human_Practices .unify").stop().slideUp();
+
});
+
+
$(".header .nav .mainnav").eq(4).hover(function(){
+
$(".header .nav .Achievement span").css("color","#FAEE0D");
+
$(".header .nav .Achievement .unify").stop().slideDown();
+
},function(){
+
$(".header .nav .Achievement span").css("color","#fff");
+
$(".header .nav .Achievement .unify").stop().slideUp();
+
});
+
+
$(".header .nav .mainnav").eq(5).hover(function(){
+
$(".header .nav .Team span").css("color","#FAEE0D");
+
$(".header .nav .Team .unify").stop().slideDown();
+
},function(){
+
$(".header .nav .Team span").css("color","#fff");
+
$(".header .nav .Team .unify").stop().slideUp();
+
 
});
 
});
 
 
 
});
 
});

Revision as of 07:54, 23 October 2017

/*Lazy loading*/ $(function(){

var winHeight=$(window).outerHeight(); var footerTop=$(".footer_box").offset().top-$(window).scrollTop();

if(footerTop<winHeight-100){ setTimeout(function(){ $(".footer").addClass("a-fadeinB"); $(".footer").css("display","block"); },150); }

$(window).scroll(function(){

winHeight=$(window).outerHeight(); footerTop=$(".footer_box").offset().top-$(window).scrollTop();

if(footerTop<winHeight-100){ setTimeout(function(){ $(".footer").addClass("a-fadeinB"); $(".footer").css("display","block"); },150); }

});

});