// JavaScript Document $(function() {   $('a[href^="#"],a[href*="#"]').on('click',function() { var mrg = $("#head").outerHeight() + 10; mrg = $("#head #logo").outerHeight() + 40; href = $(this).attr("href"); var hrefs=href.substring(href.indexOf("#")+1,href.length); href = "#"+hrefs;     var target = $(href == "#" || href == "" ? 'html' : href); if(target.length){ var position = target.offset().top - mrg; $('body,html').animate({scrollTop:position}, 500, 'swing'); return false; } }); /**アコーディオン開閉**/ $('#head #hmenu > div ul.menu#menu-hmenu2 li.search a').stop().on('click',function (e) { e.preventDefault(); $('#head #searchwrap').stop().slideToggle(); $(this).toggleClass('open'); }); $('#head #hmenu > div ul.menu#menu-hmenu2 li.en > a').stop().on('click',function (e) { e.preventDefault(); $('#head #hmenu > div ul.menu#menu-hmenu2 li.en > ul').stop().slideToggle(); }); $('#head #hmenu > div ul.menu#menu-hmenu2 li.tel a').stop().on('click',function (e) { e.preventDefault(); location.href='tel:0352872941'; }); $('#menubtn').stop().on('click',function (e) { e.preventDefault(); $('#head #header > div ul.menu#menu-gmenu').stop().slideToggle(); $(this).toggleClass('open'); }); $('#side > .sidetit').stop().on('click',function (e) { if($(this).css('background-size')=='cover'){ e.preventDefault(); $(this).stop().next('div').slideToggle(); $(this).toggleClass('open'); }else{ $(this).removeClass('open'); } }); $("a:has(img)").addClass("noicon"); $('.entry #contents .mw_wp_form td input#facility').attr('readonly',true); 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($('.mw_wp_form.mw_wp_form_input table tr:last-child td .business-description').length){ let att = $('.mw_wp_form.mw_wp_form_input table tr:last-child td .business-description span'); $('.mw_wp_form.mw_wp_form_input table tr:last-child td .business-description').remove(); $('.mw_wp_form.mw_wp_form_input table tr:last-child td .mwform-checkbox-field-text').html(att); } }); 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(); }); $(window).on('resize',function () { setsize(); //movepos(); }); $(window).on('scroll',function () { //setsize(); }); $(window).on('orientationchange', function(){ setsize(); }); function setsize(){ var hsize = $("#head").outerHeight(); if($('#head #header #logo img').css('width') == '160px'){ hsize = hsize - $("#menu").outerHeight(); }else{ $('#menubtn').removeClass('open'); $('#head #header > div ul.menu#menu-gmenu').removeAttr('style'); } $("#container").css("padding-top",hsize+"px"); $('.contents#prestige ul li p').matchHeight(); $('#event dt').matchHeight(); $('#event dd > p').matchHeight(); //$('#event dd ul.eventlist').matchHeight(); $('#event dd').matchHeight(); $('#topics li').matchHeight(); $('#other li a').matchHeight(); if($('#pickup li .img').css('display')=='inline-block'){ $('#pickup li > .detail,#pickup li > .img img').matchHeight(); }else{ $('#pickup li .detail').matchHeight(); } $('.contents .wrap.session > div').matchHeight(); if($('#side > .sidetit').css('background-size')!='cover'){ $('#side > .sidetit + div').removeAttr('style'); } } //他ページよりのアンカーリンク function movepos(){ var mrg = $("#head").outerHeight(); console.log(mrg); 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); } function formcheck(){ var flag = $('.loginform > form input#login_password').val(); var flag2 = $('.loginform > form input#login_username').val(); if(flag=='' || flag2==''){ window.alert('未入力の項目があります'); // 入力漏れがあれば警告ダイアログを表示 return false; // 送信を中止 }else{ return true; // 送信を実行 } }