// JavaScript Document //------------- ----------------- //-------------smoothScroll---------------- //------------- ----------------- /* $(function() { $( 'a[href^="#"]' ).SmoothScroll( { duration: 1000, easing : 'easeOutQuint' } ); } ); */ //------------- ----------------- //-------------ページトップボタン出現---------------- //------------- ----------------- $('head').append(''); $(window).scroll(function () { if ($(this).scrollTop() > 500) { $('#goPageTop').stop().animate({'opacity' : '1'}, 300); } else { $('#goPageTop').stop().animate({'opacity' : '0'}, 300); } }); //------------- ----------------- //-------------スマホ画像切り替え---------------- //------------- ----------------- $(function() { // 置換の対象とするclass属性。 var $elem = $('.js-image-switch'); // 置換の対象とするsrc属性の末尾の文字列。 var sp = '_sp.'; var pc = '_pc.'; // 画像を切り替えるウィンドウサイズ。 var replaceWidth = 599; function imageSwitch() { // ウィンドウサイズを取得する。 var windowWidth = parseInt($(window).width()); // ページ内にあるすべての`.js-image-switch`に適応される。 $elem.each(function() { var $this = $(this); // ウィンドウサイズが768px以上であれば_spを_pcに置換する。 if(windowWidth >= replaceWidth) { $this.attr('src', $this.attr('src').replace(sp, pc)); // ウィンドウサイズが768px未満であれば_pcを_spに置換する。 } else { $this.attr('src', $this.attr('src').replace(pc, sp)); } }); } imageSwitch(); // 動的なリサイズは操作後0.2秒経ってから処理を実行する。 var resizeTimer; $(window).on('resize', function() { clearTimeout(resizeTimer); resizeTimer = setTimeout(function() { imageSwitch(); }, 200); }); }); //------------- ----------------- //-------------colorbox---------------- //------------- ----------------- /*$(document).ready(function(){ $(".accessmap").colorbox({ transition:"fade",width:'90%'}); });*/ //------------------------------ //-------------jQuery drawer---------------- //----------------------------- $(document).ready(function () { $('.drawer').drawer(); $('header .btnMenu').on('click', function () { $('.drawer').drawer('open'); }) $('.drawer-nav .close a').on('click', function () { $('.drawer').drawer('close'); }) }); //------------------------------ //-------------inView---------------- //----------------------------- $(function() { $('.fadeUp').css('opacity',0); $('.fadeLeft').on('inview', function(event, isInView) { if (isInView) { $(this).addClass('fadeInLeft'); } else { $(this).removeClass('fadeInLeft'); $(this).css('opacity',0); } }); $('.fadeRight').on('inview', function(event, isInView) { if (isInView) { $(this).addClass('fadeInRight'); } else { $(this).removeClass('fadeInRight'); } }); $('.fadeUp').on('inview', function(event, isInView) { if (isInView) { $(this).addClass('fadeInUp'); } else { $(this).removeClass('fadeInUp'); $(this).css('opacity',0); } }); }); //------------------------------ //-------------cmボタンを消す---------------- //----------------------------- $(function(){ $(".fuwafuwa .btnClose").on("click", function(){ $(".fuwafuwa").fadeOut(); return false; }); })