(function($) {
$('.main-slider').on('init', function(event, slick) {
$('.main-slider').find('.slick-current').removeClass('slick-active').addClass('reset-animation');
setTimeout( function() {
$('.main-slider').find('.slick-current').removeClass('reset-animation').addClass('slick-active');
}, 1);
});
let vh = window.innerHeight * 0.01;
document.documentElement.style.setProperty('--vh', vh + 'px');
window.addEventListener('resize', function () {
let vh = window.innerHeight * 0.01;
document.documentElement.style.setProperty('--vh', vh + 'px');
});
// ¸ÞÀÎ ºñÁÖ¾ó ½½¶óÀÌ´õ
$('.main-slider').slick({
fade:true,
slidesToShow: 1,
draggable:true,
speed:1200,
lazyLoad: true,
autoplay: true,
dots: true,
autoplaySpeed:4000,
pauseOnFocus:false,
pauseOnHover:false,
pauseOnDotsHover:false,
pauseOnArrowsHover:false,
appendArrows:$('.arrow-con > .arrows'),
prevArrow:'',
nextArrow:'',
});
$('.main-slider').on('touchstart', e => {
$('.main-slider').slick('slickPlay');
});
// OUR WORK ½½¶óÀÌ´õ
$('.single-item').slick({
dots: false,
centerMode: true,
slidesToShow: 1,
autoplay: true,
speed: 1000,
autoplaySpeed: 2500,
lazyLoad: false,
pauseOnFocus:false,
pauseOnHover:false,
arrows: true,
});
$('.footer-select').on('click','.placeholder',function(){
var parent = $(this).closest('.footer-select');
if ( ! parent.hasClass('is-open')){
parent.addClass('is-open');
$('.footer-select.is-open').not(parent).removeClass('is-open');
}else{
parent.removeClass('is-open');
}
}).on('click','ul>li',function(){
var parent = $(this).closest('.footer-select');
parent.removeClass('is-open').find('.placeholder').text( $(this).text() );
});
$(".nav-mobile-button").click(function() {
$('.nav-mobile-bar').toggleClass('active');
$('.nav-mobile-menu').toggleClass('active');
});
var currentScrollTop = 0;
window.onload = function() {
scrollController();
$(window).on('scroll', function() {
scrollController();
});
}
function scrollController() {
currentScrollTop = $(window).scrollTop();
if (currentScrollTop < 0.1) {
$('#blog-header-container').css('top', -(currentScrollTop));
$('.main-menu').css('top', 0.1-(currentScrollTop));
if ($('.main-menu').hasClass('fixed')) {
$('.main-menu').removeClass('fixed');
$('.main-menu .menu-icon').removeClass('on');
}
} else {
if (!$('.main-menu').hasClass('fixed')) {
$('#blog-header-container').css('top', -0.1);
$('.main-menu').css('top', 0);
$('.main-menu').addClass('fixed');
$('.main-menu .menu-icon').addClass('on');
}
}
}
jQuery(document).ready(function($){
var current_path =window.location.pathname;
console.log(current_path);
$('.submenu ul li a[href="'+current_path+'"]').addClass('active');
var search = window.location.search;
$('.sul_menu div a[href="'+current_path+search+'"]').parent().addClass('on');
});
$(document).ready(function(){
$("#go-top").hide();
$(function () {
$(window).scroll(function () {
if ($(this).scrollTop() > 100) {
$('#go-top').fadeIn();
} else {
$('#go-top').fadeOut();
}
});
$('#go-top a').click(function () {
$('body,html').animate({
scrollTop: 0
});
return false;
});
});
});
jQuery(document).ready(function($){
var current_path =window.location.pathname;
console.log(current_path);
$('.sul_menu ul li a[href="'+current_path+'"]').addClass('active');
var code = getParameter('com_board_category_code')
if (code) {
code = code.split("c")[1]
$('.sul_menu a').eq(code).addClass("active_menu")
} else {
$('.sul_menu a').eq(0).addClass("active_menu") }
function getParameter(name) {
var half = location.search.split(name + '=')[1];
return half !== undefined ? decodeURIComponent(half.split('&')[0]) : null;
}
});
// FAQ
$(".open").click(function() {
var container = $(this).parents(".faq-box");
var answer = container.find(".answer");
var trigger = container.find(".faq-t");
answer.slideToggle(200);
if (trigger.hasClass("faq-o")) {
trigger.removeClass("faq-o");
} else {
trigger.addClass("faq-o");
}
if (container.hasClass("expanded")) {
container.removeClass("expanded");
} else {
container.addClass("expanded");
}
});
jQuery(document).ready(function($) {
$('.question').each(function() {
$(this).attr('data-search-term', $(this).text().toLowerCase() + $(this).find("ptag").text().toLowerCase());
});
$('.live-search-box').on('keyup', function() {
var searchTerm = $(this).val().toLowerCase();
$('.question').each(function() {
if ($(this).filter('[data-search-term *= ' + searchTerm + ']').length > 0 || searchTerm.length < 1) {
$(this).parent().parent().show();
} else {
$(this).parent().parent().hide();
}
});
});
});
$(function(){
var $refreshButton = $('#refresh');
var $results = $('#css_result');
function refresh(){
var css = $('style.cp-pen-styles').text();
$results.html(css);
}
refresh();
$refreshButton.click(refresh);
// Select all the contents when clicked
$results.click(function(){
$(this).select();
});
});
})(jQuery);