// 緊急情報 // $(function($){ // $("#emergency-area .btn-close a").click(function(){ // $("#emergency-area").hide(); // }); // }); $(function($) { var btnSp = $('.tk_btn-menu'); var navi = $('#tk_navi'); // var offset = nav.offset(); $(window).scroll(function () { if($(window).scrollTop() > 50) { btnSp.addClass('fixed'); navi.addClass('fixed-n'); } else { btnSp.removeClass('fixed'); navi.removeClass('fixed-n'); } addClassNf(); }); addClassNf(); function addClassNf() { if ($(window).width() < 768) { navi.addClass('fixed-n'); } } }); // spメニュー $(function($){ $(".tk_btn-menu a").click(function(e){ $(this).toggleClass("open"); $("#tk_navi").toggleClass("active-navi"); // $("#navi").animate({ width:'toggle' },300); e.preventDefault(); }); }); //pagetop $(function($){ var topBtn = $('.tk_page-top'); topBtn.click(function () { $('body,html').animate({ scrollTop: 0 }, 300); return false; }); }); $(function($){ var pagetop = $('.tk_page-top'); pagetop.hide(); $(window).scroll(function () { if ($(this).scrollTop() > 100) { pagetop.fadeIn(); } else { pagetop.fadeOut(); } }); }); // //アコーディオン // $(window).on('load', function () { // if ($(window).innerWidth() < 768) { // $(".sitemap-f ul li a span").parent("a").addClass("accordion"); // $(".sitemap-f ul li a span").parent("a").next(".u-layer").hide(); // $(".sitemap-f ul li a span").parent("a").click(function(e){ // $(this).toggleClass("open"); // $(this).next(".u-layer").slideToggle(); // if($(this).hasClass("open") == false){ // return; // } // e.preventDefault(); // }); // } // }); // // $('#search-area dl dd').css("display", "none"); // $(function($){ // var over_flg = false; // $('.btn-block a.cancel').click(function (e) { // $(this.hash).show(); // }); // // マウスが重なった時の処理 // $("#modal-area .modal-in").hover(function(){ // console.log(1); // over_flg = true; // }, function(){ // console.log(2); // over_flg = false; // }); // $('#modal-area .btn-close').click(function (e) { // $("#modal-area").hide(); // }); // $('#modal-area').click(function (e) { // if(over_flg == false){ // $("#modal-area").hide(); // } // }); // }); // $('.btn-to-search').click(function (e) { // $("#modal-area").show(); // }); // $(window).scroll(function () { // var windowHeight = $(window).height(), // topWindow = $(window).scrollTop(); // $('.m-color').each(function(){ // var targetPosition = $(this).offset().top; // if(topWindow > targetPosition - windowHeight + 50 && topWindow < targetPosition + 800){ // $(this).addClass("mColorO"); // }else{ // $(this).removeClass("mColorO"); // } // }); // });