// JavaScript Document // AOS AOS.init({ offset:80, duration: 900, easing: 'ease-out-back', }); if(navigator.userAgent.match(/MSIE 10/i) || navigator.userAgent.match(/Trident\/7\./) || navigator.userAgent.match(/Edge\/\d+\.\d+/)) { $('body').on("mousewheel", function () { "use strict"; event.preventDefault(); var wd = event.wheelDelta; var csp = window.pageYOffset; window.scrollTo(0, csp - wd); }); } // mobile $(function(){ "use strict"; var ua = navigator.userAgent; if(ua.indexOf('iPhone') < 0 && ua.indexOf('Android') < 0){ $('.telhref').contents().unwrap(); } else { $(".bgfix").css({ "background-attachment": "scroll"}); } }); $(function(){ "use strict"; // bigin // PageScroll var headblank = $('#header').outerHeight() + 20; var speed = 600; $(window).on("load", function(){ if(location.hash !== ""){ var hashOffset = $(location.hash).offset().top - headblank; $('html').animate({ scrollTop:hashOffset}, speed); } }); $('a[href^=#]').click(function(){ var href= $(this).attr("href"); var target = $(href === "#" || href === "" ? 'html' : href); var position = target.offset().top - headblank; $("html, body").animate({scrollTop:position}, speed, "swing"); return false; }); // pagetop var topBtn = $('#pagetop'); topBtn.hide(); $(window).on('load scroll', function(){ if ($(this).scrollTop() > 500) { topBtn.fadeIn(); } else { topBtn.fadeOut(); } // var docH = $(document).height(); // var scrlPos = $(window).height() + $(window).scrollTop(); // var footH = $("#footer").outerHeight(); // if ( docH - scrlPos <= footH ) { // topBtn.css({'position':'absolute','bottom': footH - 45 + 'px'}); // } else { // topBtn.css({'position':'fixed','bottom':'3px'}); // } }); topBtn.on('click',function(){ $('body,html').animate({ scrollTop: 0 }, 500); return false; }); // drawerNav $('.nav_toggle').on("click", function(){ $('#header').toggleClass('open'); }); // end }); // accordion $('.accordion .btn').on('click', function () { $(this).toggleClass('open').next().slideToggle(); }); // header $(document).ready(function() { "use strict"; var Item = $('#header'), Posi = $('#header').outerHeight() + 200; $(window).on('load scroll', function() { var value = $(this).scrollTop(); if ( value >= Posi ) { Item.addClass('fixed'); } else { Item.removeClass('fixed'); } }); }); // slider $('.slide_wrap' ).each( function( i ) { "use strict"; var $_t = $( this ); $_t.find( '.viewer' ).addClass( 'viewer' + i ).slick({ autoplay: true, autoplaySpeed: 3000, cssEase: 'ease-in-out', dots: false, fade: true, speed: 1000, arrows: false, swipe: true, }); $_t.find( '.t-slider' ).addClass( 't-slider' + i ).slick({ autoplay: true, autoplaySpeed: 3000, cssEase: 'ease-in-out', dots: true, arrows: true, prevArrow:'', nextArrow:'', speed: 1200, swipe: true, customPaging: function(slider, i) { var thumbSrc = $(slider.$slides[i]).find('img').attr('src'); return ''; } }); // $_t.find( '.slider' ).addClass( 'slider' + i ).slick({ // autoplay: true, // autoplaySpeed: 3000, // cssEase: 'ease-in-out', // dots: true, // fade: false, // speed: 1000, // arrows: false, // swipe: true, // }); // $_t.find( '.carousel' ).addClass( 'carousel' + i ).slick({ // autoplay: true, // autoplaySpeed: 0, // cssEase: 'linear', // speed: 10000, // arrows: false, // swipe: true, // variableWidth: true, // }); }); // plan slider $(function () { let slidesToShowNum = 4; let item = $('.item').length; if (item <= slidesToShowNum) { for ( i = 0 ; i <= slidesToShowNum + 1 - item ; i++) { $('.item:nth-child(' + i + ')').clone().appendTo('.slider_rsp'); } } $('.slider_rsp').slick({ autoplay: true, autoplaySpeed: 1000, cssEase: 'ease-in-out', dots: false, fade: false, speed: 1500, arrows: true, prevArrow:'', nextArrow:'', swipe: true, slidesToShow: slidesToShowNum, slidesToScroll: 1, responsive: [ { breakpoint: 1024, settings: { slidesToShow: 3, } }, { breakpoint: 768, settings: { slidesToShow: 2, } }, { breakpoint: 480, settings: { slidesToShow: 1, } } ] }); }); // viewport (function () { const viewport = document.querySelector('meta[name="viewport"]'); function switchViewport() { const value = window.outerWidth > 360 ? 'width=device-width,initial-scale=1' : 'width=360'; if (viewport.getAttribute('content') !== value) { viewport.setAttribute('content', value); } } addEventListener('resize', switchViewport, false); switchViewport(); })();