/* * common.funcs.js */ $(function(){ $('.pagetop').innerPageScroll(); $('#gnav li').each(function(){ if($(this).hasClass($('body').attr('id'))){ $(this).children('a').addClass('current'); return false; } }); body_class = $('body').attr('class').split(' '); $('.side_nav .nav_li>li').each(function(){ if($(this).hasClass(body_class[0]) || $(this).hasClass(body_class[1])){ $(this).addClass('current'); $(this).find('li').each(function(){ if($(this).hasClass(body_class[1])){ $(this).addClass('current_li'); $('li.current>a>span').addClass('c_black'); return false; } }); return false; } }); // var $cover = $('body').append('').find('#nav_cover').hide(); $('.btn_menu').click(function() { $(this).toggleClass('is-open'); if($(this).hasClass('is-open')){ $('body').css({ 'position' : 'fixed', 'width' : '100%' }); }else{ $('body').removeAttr('style'); } if(ua.iPad){ gnavH = size.h-$('.header_in').outerHeight(); }else{ gnavH = size.h-$('.header_in').outerHeight()-30; } $('#gnav').stop().height(gnavH).css({'overflow-y' : 'scroll'}).fadeToggle(); }); $('#header .sns_list').clone().addClass('tabletblock').appendTo('#gnav .incnt'); var facebookWrap = $('.facebook-wrapper'); var fbBeforeWidth = ''; // 前回変更したときの幅 var fbWidth = facebookWrap.width(); // 今回変更する幅 var fbTimer = false; $(window).bind("load resize", function(){ if(rspswitch){ if($('body').attr('id') == 'index'){ }else{ if(size.w > rsp.tablet){ $('.h_txt1').insertAfter('.logo'); }else{ $('.h_txt1').insertAfter('.header_in'); } } } if (fbTimer !== false) { clearTimeout(fbTimer); } fbTimer = setTimeout(function() { fbWidth = facebookWrap.width(); // 変更後の幅を取得 if(fbWidth != fbBeforeWidth) { facebookWrap.html(pagePluginCode(fbWidth)); // ページプラグインのコード変更 window.FB.XFBML.parse(); // ページプラグインの再読み込み fbBeforeWidth = fbWidth; // 今回変更分を保存しておく } }, 200); }); function pagePluginCode(w) { // 幅に応じて高さを変更する場合 var h; if(size.w > rsp.middle) { if($('body').attr('id') == 'index'){ h = 350; }else{ h = 400; } } else { h = 300; } return '
Facebook
'; } $(".btn_play").click(function(){ var id = this.id; $(".youtube_movie").html('') }); if($('body').attr('id') == 'index'){ $('#mainv').slick({ dots: true, arrows: true, nextArrow:'', prevArrow:'', // draggable:false, fade:true }); $(window).bind("load resize", function(){ if(size.w < rsp.tablet && size.w > rsp.middle){ var h = (size.w - 2040) / 2; $('#mainv').css({ 'width' : 2000, 'margin-left' : h }); }else if(size.w < rsp.middle){ var h = (size.w - 1020) / 2; $('#mainv').css({ 'width' : 1000, 'margin-left' : h }); }else{ $('#mainv').removeAttr('style'); } }); } // $('.lb').magnificPopup({ // mainClass:'mfp-zoom-in', // showCloseBtn: false, // midClick: true // }); // $('.l_btn_close').click(function(){ // $.magnificPopup.close(); return false; // }); if($('body').attr('id') == 'life'){ $('.acd_wrap dd').hide(); $('.acd_wrap dt').click(function(event) { $(this).toggleClass('is-open'); $(this).next('.acd_cnt').stop().slideToggle(); }); } if($('body').attr('id') == 'consultation' && $('body').hasClass('faq')){ $('.acd_wrap dd').hide(); $('.acd_wrap dt').click(function(event) { $(this).toggleClass('is-open'); $(this).next('.acd_cnt').stop().slideToggle(); }); var url = location.href; if(url.indexOf('#q')!=-1){ id = url.split("#q")[1]; $('.acd_wrap dt#q'+ id).addClass('is-open'); $('.acd_wrap dt#q'+ id).next('.acd_cnt').show(); } } if($('body').hasClass('category_top')){ } }); $.heightAjust({ bp: responsive.bp, bodyClass: responsive.bodyClass, target: { ".box_list" :{ attatchcase: [ false , false, false, 2, 2, 3, 3 ] } }, children: '.tit_box' }); $.heightAjust({ bp: responsive.bp, bodyClass: responsive.bodyClass, target: { ".box_list" :{ attatchcase: [ false , false, false, 2, 2, 3, 3 ] } }, children: '.box_in' });