/* HTML document is loaded. DOM is ready.
-------------------------------------------*/
$(function(){
/* start typed element */
//http://stackoverflow.com/questions/24874797/select-div-title-text-and-make-array-with-jquery
var subElementArray = $.map($('.sub-element'), function(el) { return $(el).text(); });
$(".element").typed({
strings: subElementArray,
typeSpeed: 30,
contentType: 'html',
showCursor: false,
loop: true,
loopCount: true,
});
/* end typed element */
/* Smooth scroll and Scroll spy (https://github.com/ChrisWojcik/single-page-nav)
---------------------------------------------------------------------------------*/
$('.templatemo-nav').singlePageNav({
offset: $(".templatemo-nav").height(),
filter: ':not(.external)',
updateHash: false
});
/* start navigation top js */
$(window).scroll(function(){
if($(this).scrollTop()>58){
$(".templatemo-nav").addClass("sticky");
}
else{
$(".templatemo-nav").removeClass("sticky");
}
});
/* Hide mobile menu after clicking on a link
-----------------------------------------------*/
$('.navbar-collapse a').click(function(){
$(".navbar-collapse").collapse('hide');
});
/* end navigation top js */
$('body').bind('touchstart', function() {});
/* wow
-----------------*/
new WOW().init();
});
/* start preloader */
$(window).load(function(){
$('.preloader').fadeOut(1000); // set duration in brackets
});
/* end preloader */
// postweb 170612 아래 전체 추가
;(function () {
// MagnificPopup
var magnifPopup = function() {
$('.image-popup').magnificPopup({
type: 'image',
removalDelay: 300,
mainClass: 'mfp-with-zoom',
gallery:{
enabled:true
},
zoom: {
enabled: true, // By default it's false, so don't forget to enable it
duration: 300, // duration of the effect, in milliseconds
easing: 'ease-in-out', // CSS transition easing function
// The "opener" function should return the element from which popup will be zoomed in
// and to which popup will be scaled down
// By defailt it looks for an image tag:
opener: function(openerElement) {
// openerElement is the element on which popup was initialized, in this case its tag
// you don't need to add "opener" option if this code matches your needs, it's defailt one.
return openerElement.is('img') ? openerElement : openerElement.find('img');
}
}
});
};
// Document on load.
$(function(){
magnifPopup(); // postweb 170612 추가
});
}());