"use strict"; var BASE_URL = window.location.protocol +'//'+ window.location.host + '/'; var SELF_URL = window.location.protocol + '//' + window.location.host + window.location.pathname; if(typeof jQuery === 'undefined') { throw new Error('缃戠珯JavaScript闇€瑕乯Query鏀寔'); } $(function() { FastClick.attach(document.body); //棣栭〉杞挱鍥 var homeSwiper = new Swiper('.swiper-container', { speed: 2000, spaceBetween: 30, //autoplay: 2000, scrollbar: '.swiper-scrollbar', nextButton: '.swiper-button-next', prevButton: '.swiper-button-prev', scrollbarHide: true, slidesPerView: 'auto', centeredSlides: true, grabCursor: true, direction: 'horizontal', loop: true, preloadImages: true, parallax: true, speed: 600, }); $(window).scroll(function() { if($(window).scrollTop() > 100) { $("#service-top").parent('li').fadeIn(1500); } else { $("#service-top").parent('li').fadeOut(1500); } }); $("#service-top").on('click', function(){ $("body, html").animate({ scrollTop: 0}, 500); }); $(".menu-button").on('click', function() { $(this).toggleClass('open'); if( $(this).hasClass('open')) { $(".menu").slideDown(); } else { $(".menu").slideUp(); } }); });