//============== // header sp //============== jQuery(document).ready(function($) { if (window.matchMedia( '(min-width: 851px)' ).matches) { //切り替える画面サイズ //PC環境の場合 } else { //モバイル環境の場合 var startPos = 0; $(window).scroll(function(){ var currentPos = $(this).scrollTop(); if (currentPos > startPos) { if($(window).scrollTop() >= 100) { $("header").css("top", "-50px"); } } else { $("header").css("top", 0 + "px"); } startPos = currentPos; }); //モバイル環境の場合END }; }); //============== // header sp search //============== $(function() { $('#head-sp-search').click(function(){ $('.header-sp .search').toggle(300); }); }); //============== // drawer (SP menu ) //============== $(document).ready(function() { $('.drawer').drawer(); }); //============== // sp menu submenu処理 //============== $(function() { $('.drawer-menu ul.textmenu li').click(function(){ $(this).children('ul').toggle(300); }); }); //============== // ページの先頭へもどる //============== function backToTop() { var x1 = x2 = x3 = 0; var y1 = y2 = y3 = 0; if (document.documentElement) { x1 = document.documentElement.scrollLeft || 0; y1 = document.documentElement.scrollTop || 0; } if (document.body) { x2 = document.body.scrollLeft || 0; y2 = document.body.scrollTop || 0; } x3 = window.scrollX || 0; y3 = window.scrollY || 0; var x = Math.max(x1, Math.max(x2, x3)); var y = Math.max(y1, Math.max(y2, y3)); window.scrollTo(Math.floor(x / 2), Math.floor(y / 2)); if (x > 0 || y > 0) { window.setTimeout("backToTop()", 25); } } //============== //スクロールアニメーション //============== //ズームイン表示 $(function() { $('.list-mv01').on('inview', function(event, isInView, visiblePartX, visiblePartY) { if(isInView){ $(this).stop().addClass('mv01'); } else{ $(this).stop().removeClass('mv01'); } }); }); //フェードイン表示 $(function() { $('.list-mv02').on('inview', function(event, isInView, visiblePartX, visiblePartY) { if(isInView){ $(this).stop().addClass('mv02'); } else{ $(this).stop().removeClass('mv02'); } }); }); //回転 $(function() { $('.list-mv03').on('inview', function(event, isInView, visiblePartX, visiblePartY) { if(isInView){ $(this).stop().addClass('mv03'); } else{ $(this).stop().removeClass('mv03'); } }); }); //3D回転 $(function() { $('.list-mv04').on('inview', function(event, isInView, visiblePartX, visiblePartY) { if(isInView){ $(this).stop().addClass('mv04'); } else{ $(this).stop().removeClass('mv04'); } }); }); //上移動 $(function() { $('.list-mv05').on('inview', function(event, isInView, visiblePartX, visiblePartY) { if(isInView){ $(this).stop().addClass('mv05'); } else{ $(this).stop().removeClass('mv05'); } }); }); //移動+フェードイン表示 $(function() { $('.list-mv07').on('inview', function(event, isInView, visiblePartX, visiblePartY) { if(isInView){ $(this).stop().addClass('mv07'); } else{ $(this).stop().removeClass('mv07'); } }); }); //============== //SPOT Ranking 行きたい!のクリック切り替え //============== $(function(){ $(".like .icon").click(function() { $(this).toggleClass("active"); }); }); //============== //li要素を順番にフェードイン //============== // .list $(function(){ $('head').append( '