jQuery(function ($) {
// PC ³×ºñ°ÔÀÌ¼Ç ¹Ù
$(".nav_box").on("mouseenter focusin", function () {
$(".twoDBg").slideDown(300);
$(".nav_box li .twoD").slideDown(300);
$(".header_wrap").addClass("navbar-scroll");
});
$(".nav_box").on("mouseleave", function () {
$(".twoDBg, .nav_box li .twoD").stop().slideUp(200);
if ($(document).scrollTop() <= 50) {
$(".header_wrap").removeClass("navbar-scroll");
}
});
// ¼ºê¸Þ´º Ȱ¼ºÈ
var currentURL = location.href.toLowerCase();
$(".nav-active>li>a").each(function () {
if (currentURL.indexOf(this.href.toLowerCase()) > -1) {
$(".nav-active>li>a.active").removeClass("active");
$(this).addClass("active");
}
});
$("li>a.active")
.parents()
.each(function () {
if ($(this).is("li>a")) {
$(this).addClass("active");
}
});
// sample > contact > wide > formmail
$("#formmail-wide input[name='add1']").attr("placeholder", "À̸§");
$("#formmail-wide input[name='add2']").attr("placeholder", "¿¬¶ôó");
$("#formmail-wide input[name='add3']").attr("placeholder", "À̸ÞÀÏ");
$("#formmail-wide textarea[name='add4']").attr("placeholder", "¹®Àdz»¿ë");
// ¸Þ´º¹Ù ½ºÅ©·Ñ ¾÷
let lastScrollTop = 0;
window.addEventListener("scroll", function (event) {
let element = jQuery(this);
var bodyHeight = document.body;
var totalHeight = bodyHeight.scrollHeight;
let st = element.scrollTop();
let ih = element.innerHeight();
if (st > lastScrollTop || st == totalHeight-ih) {
jQuery("#header.sticky-on-scrollup").removeClass("show-sticky-onscroll"); // ¹ØÀ¸·Î
jQuery("#mobileNavBar").addClass("show-sticky-onscroll");
} else if (st <= lastScrollTop || st == 0) {
jQuery("#header.sticky-on-scrollup").addClass("show-sticky-onscroll"); // À§·Î
jQuery("#mobileNavBar").removeClass("show-sticky-onscroll");
}
lastScrollTop = st;
console.log("scrollTop : " + st )
console.log("outerHeight : " + totalHeight )
console.log("innerHeight : " + ih )
console.log(st == totalHeight-ih)
});
// let lastY = 0;
// document.addEventListener("touchmove", function (event) {
// let currentY = event.touches[0].clientY;
// if (currentY > lastY) {
// // Up Scroll
// jQuery("#header.sticky-on-scrollup").addClass("show-sticky-onscroll");
// jQuery("#mobileNavBar").removeClass("show-sticky-onscroll");
// } else {
// // Down Scroll
// jQuery("#header.sticky-on-scrollup").removeClass("show-sticky-onscroll");
// jQuery("#mobileNavBar").addClass("show-sticky-onscroll");
// }
// lastY = currentY;
// });
}); // jQuery END
// ±â¾÷Çü > ¸ÞÀÎ
jQuery(window).on("pluginCarouselReady", function () {
jQuery("#oc-main").owlCarousel({
items: 2,
margin: 25,
nav: true,
navText: [
'',
'⟶',
],
dots: false,
responsive: {
576: { items: 1 },
768: { items: 1 },
},
});
});
// ±â¾÷Çü > »ç¾÷¼Ò°³ A
jQuery(window).on("pluginCarouselReady", function () {
jQuery("#oc-review").owlCarousel({
items: 1,
margin: 25,
loop: true,
autoplay: 3000,
nav: true,
navText: [
'⟵',
'⟶',
],
dots: false,
responsive: {
576: { items: 2 },
768: { items: 4 },
},
});
});
// ±â¾÷Çü > Á¦Ç°¼Ò°³ B
jQuery(document).on(
"click",
"#portfolio .portfolio-item .portfolio-image>a",
function () {
var isDisplay = jQuery(this).children(".hover").css("display");
if (isDisplay == "block") {
jQuery(this).children(".hover").stop().fadeOut();
jQuery(this).parent().removeClass("on");
} else {
jQuery(".hover").stop().fadeOut();
jQuery(this).children(".hover").stop().fadeToggle();
jQuery(".menu_list>ul>li").removeClass("on");
jQuery(this).parent().addClass("on");
}
return false;
}
);
// ÀÚÁÖÇÏ´Â Áú¹® ÇÊÅͰª
jQuery(document).ready(function () {
var $faqItems = jQuery("#faqs .faq");
if (window.location.hash != "") {
var faqFilterHash = window.location.hash.split("#")[1];
if ($faqItems.hasClass(faqFilterHash)) {
jQuery(".customjs.grid-filter li").removeClass("activeFilter");
jQuery('[data-filter=".' + faqFilterHash + '"]')
.parent("li")
.addClass("activeFilter");
var faqSelector = "." + faqFilterHash;
$faqItems.css("display", "none");
if (faqSelector != "all") {
jQuery(faqSelector).fadeIn(500);
} else {
$faqItems.fadeIn(500);
}
}
}
jQuery(".customjs.grid-filter a").on("click", function () {
jQuery(".customjs.grid-filter li").removeClass("activeFilter");
jQuery(this).parent("li").addClass("activeFilter");
var faqSelector = jQuery(this).attr("data-filter");
$faqItems.css("display", "none");
if (faqSelector != "all") {
jQuery(faqSelector).fadeIn(500);
} else {
$faqItems.fadeIn(500);
}
return false;
});
});
// Äü Æû¸ÞÀÏ
jQuery(document).ready(function () {
var elementParent = jQuery(".floating-contact-wrap");
jQuery(".floating-contact-btn")
.off("click")
.on("click", function () {
elementParent.toggleClass("active");
});
});