//ブラウザーの違いを判別 var userAgent = window.navigator.userAgent.toLowerCase(); if (userAgent.indexOf('msie') != -1 || userAgent.indexOf('trident') != -1) { //IE向けの記述 $(".card-item").removeClass("lazyload card-item").removeAttr('data-bg'); $(".msg-img").removeClass("lazyload"); $(".msg-img").each(function () { if ($(this).is('[data-src]')) { var dataSrc = $(this).data('src'); $(this).attr('src', dataSrc); } }); }; $(function () { var headerHight = 120; $('a[href*="#"]:not([href="#"])').click(function () { var speed = 500; var href = $(this).attr('href'); var url = location.protocol + '//' + location.hostname + location.pathname; href = href.replace(url, ''); var target = $(href == '#' || href == '' ? 'html' : href); var position = target.offset().top - headerHight; $('html, body').animate({ scrollTop: position }, speed, 'swing'); return false; }); }); //追従ボタン $(function () { var topBtn = $('.top-btn'); topBtn.hide(); $(window).scroll(function () { if ($(this).scrollTop() > 100) { topBtn.fadeIn(); } else { topBtn.fadeOut(); } }); }); /* facilityスライダー */ function slickOriginalSetting() { if(window.matchMedia("(min-width: 600px)").matches){ $('.js-slider').slick("slickSetOption", "slidesToScroll", 1, true); } } $(function(){ $('.js-slider').slick({ fade: false, dots: true, autoplaySpeed: 2700, speed: 2200, autoplay: true, arrows: true, slidesToShow: 1, draggable: false, centerMode: true, centerPadding: '35%', lazyLoad: 'progressive', prevArrow: '
', nextArrow: '', responsive: [ { breakpoint: 599, settings: { slidesToShow: 1, slidesToScroll: 1, centerPadding: '22px', speed: 1200, } } ] }); slickOriginalSetting(); $(window).on('resize', function() { slickOriginalSetting(); }); }); $(function(){ $('.js-slider_user-voice').slick({ fade: false, dots: true, autoplaySpeed: 2700, speed: 2200, autoplay: true, arrows: true, slidesToShow: 1, draggable: false, centerMode: true, centerPadding: '0%', lazyLoad: 'progressive', prevArrow: '', nextArrow: '', responsive: [ { breakpoint: 599, settings: { slidesToShow: 1, slidesToScroll: 1, centerPadding: '22px', speed: 1200, } } ] }); slickOriginalSetting(); $(window).on('resize', function() { slickOriginalSetting(); }); }); /* 施設スライドをクリックしたら、施設要素にスクロールする ※idのアンカーリンクだと不具合が発生した為こちらの処理を追加 */ $(function () { $targetLink = $('.js-facility-link'); $targetLink.on('click', function() { pos = $('#facility').offset().top; if(window.matchMedia("(min-width: 600px)").matches){ adjust = 0; } else { adjust = 80; } $("html,body").animate({scrollTop:pos - adjust}, 1000); }); });