/* * 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 ''; } $(".btn_play").click(function(){ var id = this.id; $(".youtube_movie").html('') }); if($('body').attr('id') == 'index'){ $('#mainv').slick({ dots: true, arrows: true, nextArrow:'