/*===================== groval-navi-icon ===================================*/ /* var userAgent = window.navigator.userAgent.toLowerCase(); var ua = (navigator.userAgent.indexOf('iPhone') > 0 || navigator.userAgent.indexOf('iPad') > 0 || navigator.userAgent.indexOf('iPod') > 0 || navigator.userAgent.indexOf('Android') > 0 || navigator.userAgent.indexOf('Mobile') > 0); if (ua){ $('.sp-btn').css('display','block'); $('#top .modal').remove(); } */ var _ua = (function(u){ return { Tablet:(u.indexOf("windows") != -1 && u.indexOf("touch") != -1) || u.indexOf("ipad") != -1 || (u.indexOf("android") != -1 && u.indexOf("mobile") == -1) || (u.indexOf("firefox") != -1 && u.indexOf("tablet") != -1) || u.indexOf("kindle") != -1 || u.indexOf("silk") != -1 || u.indexOf("playbook") != -1, Mobile:(u.indexOf("windows") != -1 && u.indexOf("phone") != -1) || u.indexOf("iphone") != -1 || u.indexOf("ipod") != -1 || (u.indexOf("android") != -1 && u.indexOf("mobile") != -1) || (u.indexOf("firefox") != -1 && u.indexOf("mobile") != -1) || u.indexOf("blackberry") != -1 } })(window.navigator.userAgent.toLowerCase()); if(_ua.Mobile){ $('.sp-btn').css('display','block'); $('#top .modal').remove(); } /*===================== groval-navi-icon ===================================*/ $(".g-navi ul a").on({ 'mouseenter': function() { $('.icon img',this).css('width','54px'); $('span',this).eq(1).css({ "left": "-=7px", "top" : "-=5px" }); }, 'mouseleave': function() { $('.icon img',this).css('width','40px'); $('span',this).eq(1).css({ "left": "+=7px", "top" : "+=5px" }); } }); /*===================== font-size ===================================*/ $(function() { var idx = 0; var elm = $('body'); var setFontSize = 0; if(($.cookie('current') == undefined)) { idx = $.cookie('current', '1', {path:'/', expires:7}); setFontSize = $.cookie('bodyFontSize', 'm-font', {path:'/', expires:7}); fontChange(); } else { idx = $.cookie('current'); setFontSize = $.cookie('bodyFontSize'); fontChange(); }; $('.font').click( function() { var nowidx = $('.font').index(this); var nowFontSize = this.id; $.cookie('current', nowidx, {path:'/', expires:7}); setFontSize = $.cookie('bodyFontSize', nowFontSize, {path:'/', expires:7}); idx = $.cookie('current'); setFontSize = $.cookie('bodyFontSize'); fontChange(); } ); function fontChange() { $('.font').removeClass('cur'); $('.font').eq(idx).addClass('cur'); elm.removeAttr('class'); elm.addClass(setFontSize); }; $('#l-font').click( function() { $('.heightLine').css('min-height','130px'); function equalHeight(group) { tallest = 0; group.each(function() { thisHeight = $(this).height(); if(thisHeight > tallest){ tallest = thisHeight; } }); group.height(tallest); } $(document).ready(function() { equalHeight($(".heightLine")); }); }); $('#s-font').click( function() { $('.heightLine').css('min-height','inherit'); function equalHeight(group) { tallest = 0; group.each(function() { thisHeight = $(this).height(); if(thisHeight > tallest){ tallest = thisHeight; } }); group.height(tallest); } $(document).ready(function() { equalHeight($(".heightLine")); }); }); $('#m-font').click( function() { $('.heightLine').css('min-height','100px'); function equalHeight(group) { tallest = 0; group.each(function() { thisHeight = $(this).height(); if(thisHeight > tallest){ tallest = thisHeight; } }); group.height(tallest); } $(document).ready(function() { equalHeight($(".heightLine")); }); });}); /*===================== mouseover ===================================*/ $(function(){ var imgcache=new Object(); $(".over").not("[src*='_o.']").each(function(i){ var imgsrc=this.src; var dot=this.src.lastIndexOf('.'); var imgovr=this.src.substr(0,dot)+'_o'+this.src.substr(dot,4); imgcache[this.src]=new Image(); imgcache[this.src].src=imgovr; $(this).hover(function(){ this.src=imgovr; },function(){ this.src=imgsrc; }); }); }); /*===================== pagetop ===================================*/ $(function() { var topBtn = $('.page-top'); topBtn.hide(); $(window).scroll(function () { if ($(this).scrollTop() > 100) { topBtn.fadeIn(); } else { topBtn.fadeOut(); } }); //スクロールしてトップ topBtn.click(function() { $('body,html').animate({ scrollTop: 0 }, 500); return false; }); }); /*===================== top_video ===================================*/ // var // video = document.getElementById("video"), // playBtn = $('#top #play-btn'); // $(function(){ // $(playBtn).click(function(){ // $(this).hide(); // video.play(); // }); // $(video).on({ // 'play':function(){ // $(playBtn).hide(); // }, // 'pause':function(){ // $(playBtn).show(); // } // }); // // $(video).Play(function(){ // // $(playBtn).hide(); // // }); // // $(video).StopPlay(function(){ // // $(playBtn).show(); // // }); // }); /*===================== modal_on_off ===================================*/ $(function(){ $('.movie').on({ 'click': function(){ if($('.modal').css('display') == 'none'){ $('.modal').fadeIn('fast'); $('body').css('overflow','hidden'); } } }) $('.close,.gray-area').on({ 'click': function(){ if($('.modal').css('display') == 'block'){ $('.modal').fadeOut('fast'); $('body').css('overflow','auto'); $(".video-js")[0].player.pause(); } } }) }); /*===================== parallax & bird-fly ===================================*/ var now = (new Date()).getTime(), src = $('.fly a img').attr('src'); $('.fly a img').attr('src', src + '?' + now); //gifアニメーションの為のキャッシュの削除 var browserHeight = window.innerHeight, // contentsHeight = document.body.clientHeight; contentsHeight = document.documentElement.clientHeight; $(function(){ var bgps = 0, flyBird = $('.fly') $(window).scroll(function () { //parallax bgps+= 1; $('body').css('background-position', 'center ' + bgps + 'px'); //bird-fly var y = jQuery(this).scrollTop(), flyPoint = contentsHeight - y; if(flyPoint <= 1000){ $(flyBird).show(); } }); $('.btn-area').on({ 'mouseover': function(){ $(flyBird).show(); } }) }); /*===================== footer-adjust ===================================*/ var addMargin = browserHeight - contentsHeight, footAdjust = $('#foot-adjust'), footMargin = parseInt($(footAdjust).css('margin-bottom'), 10); $(function(){ if(addMargin > 0){ $(footAdjust).css('margin-bottom', footMargin + addMargin); } }); /*===================== nav current ===================================*/ $(document).ready(function(){ $('.customer_cur').hide(); $('.about_cur').hide(); $('.howto_cur').hide(); $('.search_cur').hide(); $('.faq_cur').hide(); $('.voice_cur').hide(); $('.special_cur').hide(); $(window).bind("load", function(){ var customer = "/customer/"; var about = "/customer/about"; var howto = "/customer/howto"; var Search = "/customer/search"; var faq = "/customer/faq"; var voice = "/customer/voice"; var special = "/customer/special/"; var pagePath = location.pathname; /*console.log(pagePath);*/ var customerMatch = pagePath.match(customer); var aboutMatch = pagePath.match(about); var howtoMatch = pagePath.match(howto); var SearchMatch = pagePath.match(Search); var faqMatch = pagePath.match(faq); var voiceMatch = pagePath.match(voice); var specialMatch = pagePath.match(special); if (pagePath == customer) { $('.customer_cur').show() $('.customer_def').hide() }else { $('.customer_cur').hide() $('.customer_def').show() } /*if ( customerMatch == customer){ $('.customer_cur').show() $('.customer_def').hide() }else { $('.customer_cur').hide() $('.customer_def').show() }*/ if ( aboutMatch == about){ $('.about_cur').show() $('.about_def').hide() $('.customer_cur').hide() $('.customer_def').show() }else { $('.about_cur').hide() $('.about_def').show() } if ( howtoMatch == howto){ $('.howto_cur').show() $('.howto_def').hide() $('.customer_cur').hide() $('.customer_def').show() }else { $('.howto_cur').hide() $('.howto_def').show() } if ( SearchMatch == Search){ $('.search_cur').show() $('.search_def').hide() $('.customer_cur').hide() $('.customer_def').show() }else { $('.search_cur').hide() $('.search_def').show() } if ( faqMatch == faq){ $('.faq_cur').show() $('.faq_def').hide() $('.customer_cur').hide() $('.customer_def').show() }else { $('.faq_cur').hide() $('.faq_def').show() } if ( voiceMatch == voice){ $('.voice_cur').show() $('.voice_def').hide() $('.customer_cur').hide() $('.customer_def').show() }else { $('.voice_cur').hide() $('.voice_def').show() } if ( specialMatch == special){ $('.special_cur').show() $('.special_def').hide() $('.customer_cur').hide() $('.customer_def').show() }else { $('.special_cur').hide() $('.special_def').show() } }); }); /*===================== 高さ揃え ===================================*/ 'jQuery' in window && (function($) { function equalHeight(group) { tallest = 0; group.each(function() { thisHeight = $(this).height(); if(thisHeight > tallest){ tallest = thisHeight; } }); group.height(tallest); } $(window).load(function() { equalHeight($(".heightLine")); }); })(jQuery);