// 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");
}
//莉悶�繝シ繧ク繧医j縺ョ繧「繝ウ繧ォ繝シ繝ェ繝ウ繧ッ
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');
}
}