// JavaScript Document $(function() {   $('a[href^="#"],a[href*="#"]').on('click',function() { var mrg = $("#head").outerHeight() + 10; href = $(this).attr("href"); var hrefs=href.substring(href.indexOf("#")+1,href.length); href = "#"+hrefs;     var target = $(href == "#" || href == "" ? 'html' : href); var position = target.offset().top - mrg;     $('body,html').animate({scrollTop:position}, 500, 'swing'); return false; }); /**SPメニューアコーディオン開閉**/ if($(window).width() <= 640 ){ $('#spmenu .menu-spmenu-container > ul > li.menu-item-has-children > a').stop().on('click',function(e){ e.preventDefault(); $(this).toggleClass('open'); $(this).next('ul').stop().slideToggle(); }); }else{ $('#spmenu .menu-spmenu-container > ul > li > a').removeClass('open'); $('#spmenu .menu-spmenu-container > ul > li > ul').removeAttr('style'); } /**SPフッターアコーディオン開閉**/ if($(window).width() <= 640 ){ $('#footer #menu-fmenu > li.menu-item-has-children > a').stop().on('click',function(e){ e.preventDefault(); $(this).toggleClass('open'); $(this).next('ul').stop().slideToggle(); }); }else{ $('#footer #menu-fmenu > li > a').removeClass('open'); $('#footer #menu-fmenu > li > ul').removeAttr('style'); } $('.spbtn').stop().on('click',function (e) { e.preventDefault(); $('#spmenu').toggleClass('open'); $(this).toggleClass('open'); }); setsize(); //本アップ対応 $("li.off a, #entrymenu > li > a").click(function(e) { e.preventDefault; return false; }); //telリンク /* if(uaname != "sp"){ $(".tel a").click(function(e) { e.preventDefault; return false; }); } */ if($('.mwform-zip-field').length){ $('.mwform-zip-field > input:first-child').attr('id','zip'); $('.mwform-zip-field > input:last-child').attr('id','zip1'); } if($('input.hidden').length){ $('input.hidden').attr('readonly','readonly'); } if($('.entry #contents tr:first-child td select').length){ $('.entry #contents tr:first-child td select').attr('readonly','readonly'); } if($('.mw_wp_form').length){ var val = $('#jobget').val(); if(val){ $('#jobset').val(val); } } }); if(navigator.userAgent.match(/MSIE 10/i) || navigator.userAgent.match(/Trident\/7\./) || navigator.userAgent.match(/Edge\/12\./)) { $('body').on("mousewheel", function () { event.preventDefault(); var wd = event.wheelDelta; var csp = window.pageYOffset; window.scrollTo(0, csp - wd); }); } $(window).on('load',function(){ setsize(); movepos(); resetSP() }); $(window).on('resize',function () { setsize(); movepos(); resetSP() }); $(window).on('scroll',function () { //setsize(); }); $(window).on('orientationchange', function(){ setsize(); resetSP() }); function setsize(){ var hsize = $("#head").outerHeight(); $("#container").css("padding-top",hsize+"px"); } //他ページよりのアンカーリンク function movepos(){ var mrg = $("#head").outerHeight() + 10; var href = location.href; if(href.indexOf("#")>=0 || location.search){ var hrefs=href.substring(href.indexOf("#")+1,href.length); href = hrefs; var position = $("#"+href).offset().top; var speed = 500; $('body,html').animate({scrollTop:position-mrg}, speed, 'swing'); }else{ return false; } var hashString = location.hash.substr(1); history.replaceState('', document.title, window.location.pathname); } /**PCの場合アコーディオンリセット**/ function resetSP(){ if($(window).width() > 640 ){ $('#spmenu .menu-spmenu-container > ul > li > a').removeClass('open'); $('#spmenu .menu-spmenu-container > ul > li > ul').removeAttr('style'); $('#footer #menu-fmenu > li > a').removeClass('open'); $('#footer #menu-fmenu > li > ul').removeAttr('style'); $('#spmenu').removeClass('open'); $('#spbtn').removeClass('open'); } }