// JavaScript Document //pagescroll jQuery(function($) { $('a[href^="#"]').not('.noScr a').click(function() { var speed = 500; var href = $(this).attr("href"); var target = $(href == "#" || href == "" ? 'html' : href); if (target.offset()) { var position = target.offset().top; $("html, body").animate({scrollTop: position}, speed, "swing"); } return false; }); }); //言語切り替え jQuery(function($){ $(".tk_language dt").click(function(){ $(".tk_language dd").slideToggle(); $(this).toggleClass("active"); }); }); //メニューの開閉 jQuery(function($){ $(".tk_search-menu h4").click(function(){ $(this).next(".inner").slideToggle(); $(this).toggleClass("active"); }); }); //spメニュー $(function(){ var state = false; var scrollpos; $('.tk_btn-spnav a').click(function(){ if(state == false) { scrollpos = $(window).scrollTop(); $('body').addClass('tk_fixed').css({'top': -scrollpos}); $('.tk_spnav').addClass('tk_open'); $("button.tk_btn-close").on("click", function() { $('.tk_spnav').removeClass('tk_open'); $('body').removeClass('tk_fixed').css({'top': 0}); state = false; }); state = true; } else { $('body').removeClass('tk_fixed').css({'top': 0}); window.scrollTo( 0 , scrollpos ); $('.tk_spnav').removeClass('tk_open'); state = false; } }); }); //fontsize jQuery(function($){ var fz = $.cookie('fontSize'); if(fz) { if(fz == 'fzM') { $('html').css('fontSize', '62.5%'); } } n = $.cookie('opened'); if ( n == null ) { n = 0;} $('.fontsize dd').eq(n).addClass("active"); $('.fontsize dd').click(function() { var thisSize = this.id; var thisIndex = $(this).parent("dl").children("dd").index(this); $('.fontsize dd').removeClass('active'); $(this).addClass('active'); $.cookie('fontSize', thisSize); $.cookie('opened',thisIndex); if(thisSize == 'fzM') { $('html').css('font-size', '62.5%'); }else if(thisSize == 'fzL') { $('html').css('font-size', '125%'); $('#header,#gnav,#top-gnav').css('font-size', '0'); $('#gnav .comingsoon span,#top-gnav .comingsoon span').css('font-size', '10px'); $('.fontsize dd a').css('font-size', '11px'); $('.shere dt,.fontsize dt').css('font-size', '12px'); $('#gnav li a,#top-gnav li a').css('font-size', '17px'); $('.language,.h-serch input,#gnav li li a,#gnav li a::before').css('font-size', '15px'); $('.shere dd a,.h-serch a').css('font-size', '20px'); } }); }); jQuery(function ($) { $('.fontsize dd').click(function () { // if matchheight is loaded, update layouts if (typeof $.fn.matchHeight !== 'undefined') { $.fn.matchHeight._update(); } }); }); //fontsize //jQuery(function($){ // // //クッキーがあればfontsizeを取得 // var fz = $.cookie('fontsize'); // //fzM = 100% // //fzL = 150% // if(fz) { // if(fz == 'fzL') { // $('#contents').css('fontsize', '150%'); // } // } // //クッキーがあればopenedを取得 // n = $.cookie('opened'); // if ( n == null ) { n = 0;} // $('.fontsize dd').eq(n).addClass("active"); // // //サイズ変更時にクッキーに保存 // $('.fontsize dd').click(function() { // // //idを取得する // var thisSize = this.id; // var thisIndex = $(this).parent("dl").children("dd").index(this); // // $('.fontsize dd').removeClass('active'); // $(this).addClass('active'); // // //クッキーに保存 // $.cookie('fontsize', thisSize); // $.cookie('opened',thisIndex); // // //クリックしたサイズを反映 // if(thisSize == 'fzM') { // $('#contents').css('font-size', '100%'); // }else if(thisSize == 'fzL') { // $('#contents').css('font-size', '150%'); // } // }); //}); //jQuery(function($){$('.fontsize dd').click(function() { // $.fn.matchHeight._update() });}); //