66 lines
1.7 KiB
JavaScript
66 lines
1.7 KiB
JavaScript
$(function(){
|
|
var headerIdx = 0;
|
|
|
|
$(".downArrow").on("click", function(){
|
|
$("html, body").stop().animate({"scrollTop" : sectionTop[1]-70},600)
|
|
})//home에서 아래 화살표 클릭시 이동
|
|
|
|
$(".gnb > ul > li").on("mouseover", function(){
|
|
|
|
headerIdx = $(".headerM").index($(this));
|
|
$(".sub_bg").stop().slideDown(200);
|
|
$(".sub").eq(headerIdx-1).stop().slideDown(100);
|
|
if($(this).hasClass("hit")) {
|
|
|
|
$(".sub").hide();
|
|
$(".sub_bg").stop().slideUp(100);
|
|
}
|
|
|
|
|
|
console.log("메뉴IDX", headerIdx)
|
|
})//메뉴 호버
|
|
|
|
$(".lang").on("click", function(){
|
|
$(this).find("ul").toggle();
|
|
})
|
|
|
|
|
|
|
|
|
|
$(".gnb > ul > li").on("mouseleave", function(){
|
|
$(".sub_bg").stop().slideUp(200);
|
|
$(".sub").hide();
|
|
|
|
console.log("메뉴IDX", headerIdx)
|
|
})//메뉴 호버
|
|
|
|
$(window).on("scroll", function(){
|
|
|
|
var scrollH = $(window).scrollTop();
|
|
|
|
if(scrollH >100) {
|
|
$(".upArrow").stop().fadeIn(400)
|
|
$("header").css({"background-color" : "#1e3571"})
|
|
}else {
|
|
$(".upArrow").stop().fadeOut(400)
|
|
$("header").css({"background-color" : "rgba(000,000,000,0.3)"})
|
|
}//위로 올라가기 나타남과 없어짐
|
|
|
|
// if(scrollH >sectionTop[1]-200) {
|
|
// $("header").css({"background" : "#2381e3"}) //rgba(000,000,000,0.5)
|
|
// }else {
|
|
// $("header").css({"background" : "none"})
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})// upArrow 나타내기
|
|
|
|
$(".upArrow").on("click", function(){
|
|
$("html, body").stop().animate({"scrollTop" : 0},400)
|
|
})//올라가기 위로
|
|
})
|