/* ---------- js ---------- */ jQuery(function ($) { $(window).scroll(function () { var w_top = $(window).scrollTop(); if (w_top > 146) { $("#headerInner").addClass("fixed"); } else { $("#headerInner").removeClass("fixed"); } }); /* =============== Animations =============== */ var contentWayPoint = function () { var i = 0; $('.animate-box').waypoint(function (direction) { if (direction === 'down' && !$(this.element).hasClass('animated')) { i++; $(this.element).addClass('item-animate'); setTimeout(function () { $('body .animate-box.item-animate').each(function (k) { var el = $(this); setTimeout(function () { var effect = el.data('animate-effect'); if (effect === 'fadeIn') { el.addClass('fadeIn animated'); } else if (effect === 'fadeInLeft') { el.addClass('fadeInLeft animated'); } else if (effect === 'fadeInRight') { el.addClass('fadeInRight animated'); } else { el.addClass('fadeInUp animated'); } el.removeClass('item-animate'); }, k * 200, 'easeInOutExpo'); }); }, 100); } }, { offset: '85%' }); }; var counter = function () { $('.js-counter').countTo({ formatter: function (value, options) { return value.toFixed(options.decimals); }, }); }; var counterWayPoint = function () { if ($('#counter-animate').length > 0) { $('#counter-animate').waypoint(function (direction) { if (direction === 'down' && !$(this.element).hasClass('animated')) { setTimeout(counter, 400); $(this.element).addClass('animated'); } }, { offset: '90%' }); } }; $(window).scroll(function () { if ($(this).scrollTop() > 50) { $('.back-to-top').fadeIn('slow'); } else { $('.back-to-top').fadeOut('slow'); } }); $('.back-to-top').click(function () { $("html, body").animate({ scrollTop: 0 }, 500); return false; }); $('.go-to-top').click(function () { $("html, body").animate({ scrollTop: 0 }, 500); return false; }); // Document on load. $(function () { contentWayPoint(); }); }); $(function () { var video_youtube = new Array(); var thumbCount; function galleryInit() { if ($(".bbsnewf5").length > 0) { thumbCount = $(".popupVideo .bbsnewf5").length; for (i = 0; i < thumbCount; i++) { video_youtube[i] = $(".popupVideo .bbsnewf5").eq(i).find('.gallery_etc font').text().replace('À¯Æ©ºê°æ·Î : ', ''); $(".popupVideo .bbsnewf5").eq(i).find('table td a').attr("data-video", video_youtube[i]); } } } galleryInit(); }); $(".popupVideo .bbsnewf5 tr td a").removeAttr("href"); $(".popupVideo a").click(function () { $(".video-popup").addClass("reveal"), $(".video-popup .video-wrapper").remove(), $(".video-popup").append("
") }); $(".video-popup-closer").click(function () { $(".video-popup .video-wrapper").remove(), $(".video-popup").removeClass("reveal") });