//popup $(document).scroll(function() { var scroll = $(this).scrollTop(); if (scroll >= 150) { $("#popUp").css("margin-left", "-400px"); $("#plus").css("margin-left", "0px"); } }); $("#plus").click(function() { $("#popUp").css("margin-left", "0px"); $("#plus").css("margin-left", "-400px"); }); $("#close").click(function() { $("#popUp").css("margin-left", "-400px"); $("#plus").css("margin-left", "0px"); }); 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'); } } } $('.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); }); // 메인 비주얼 슬라이더 $('.main-slider').slick({ fade:true, slidesToShow: 1, draggable:false, speed:1200, lazyLoad: false, autoplay: true, dots: true, autoplaySpeed:4000, pauseOnFocus:false, pauseOnHover:false, appendArrows:$('.arrow-con > .arrows'), prevArrow:'', nextArrow:'', }); // PROJECT 슬라이더 $('.single-item').slick({ dots: false, slidesToShow: 3, speed: 1000, autoplay: true, autoplaySpeed: 1600, lazyLoad: false, pauseOnFocus:false, pauseOnHover:false, arrows: true, responsive: [ { breakpoint: 961, //화면 사이즈 960px settings: { slidesToShow:2 } }, { breakpoint: 481, //화면 사이즈 480px settings: { slidesToShow:1 } } ] }); $('.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() ); }); 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(); } }); }); }); /* document.querySelector(".main-visual").style.height = window.innerHeight + "px"; */ $(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(); }); });