jQuery(function($) {
// ===========================================
// SubMenu active
// ===========================================
var str = location.href.toLowerCase();
$('.nav-active>li>a').each(function() {
if (str.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");
}
});
// ===========================================
// form mail : style 2
// ===========================================
$("#formmail-style-2 input.formmail_border[name='add1']").attr('placeholder', 'name');
$("#formmail-style-2 input.formmail_border[name='add2']").attr('placeholder', 'mail');
$("#formmail-style-2 input.formmail_border[name='add3']").attr('placeholder', 'phone');
$("#formmail-style-2 textarea.formmail_textarea_style[name='description1']").attr('placeholder', 'Describe your project');
// ===========================================
// ¸Þ´º¹Ù
// ===========================================
var lastScrollTop = 0;
window.addEventListener("scroll", function(event) {
var st = jQuery(this).scrollTop();
if (st > lastScrollTop) {
jQuery('#header.sticky-on-scrollup').removeClass('show-sticky-onscroll'); // Down Scroll
} else {
jQuery('#header.sticky-on-scrollup').addClass('show-sticky-onscroll'); // Up Scroll
}
lastScrollTop = st;
});
});
// ===========================================
// ±â¾÷Çü > ¸ÞÀÎ
// ===========================================
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
}
},
});
});
jQuery(function($) {
var $faqItems = $('#faqs .faq');
if( window.location.hash != '' ) {
var getFaqFilterHash = window.location.hash;
var hashFaqFilter = getFaqFilterHash.split('#');
if( $faqItems.hasClass( hashFaqFilter[1] ) ) {
$('.grid-filter li').removeClass('activeFilter');
$( '[data-filter=".'+ hashFaqFilter[1] +'"]' ).parent('li').addClass('activeFilter');
var hashFaqSelector = '.' + hashFaqFilter[1];
$faqItems.css('display', 'none');
if( hashFaqSelector != 'all' ) {
$( hashFaqSelector ).fadeIn(500);
} else {
$faqItems.fadeIn(500);
}
}
}
$('.grid-filter a').on( 'click', function(){
$('.grid-filter li').removeClass('activeFilter');
$(this).parent('li').addClass('activeFilter');
var faqSelector = $(this).attr('data-filter');
$faqItems.css('display', 'none');
if( faqSelector != 'all' ) {
$( faqSelector ).fadeIn(500);
} else {
$faqItems.fadeIn(500);
}
return false;
});
});
// ===========================================
// ±â¾÷Çü > »ç¾÷¼Ò°³ A
// ===========================================
jQuery(window).on('pluginCarouselReady', function() {
jQuery('#oc-testi').owlCarousel({
items: 1,
margin: 25,
nav: true,
navText: ['⟵', '⟶'],
dots: false,
responsive: {
576: {
items: 1
},
768: {
items: 2
}
},
});
});
// ===========================================
// ±â¾÷Çü > Á¦Ç°¼Ò°³ B
// ===========================================
jQuery(document).on("click", "#portfolio .portfolio-item .portfolio-image>a", function() {
var is_display = jQuery(this).children(".hover").css("display");
if (is_display == "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;
});