// JavaScript Document $(function() {   $('a[href^="#"],a[href*="#"]').not('.switcher a').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); var position = target.offset().top - mrg;     $('body,html').animate({scrollTop:position}, 500, 'swing'); return false; }); setsize(); //本アップ対応 $("a.nolink").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($('.contbox.schedule1').length){ //var scl = $('.contbox.schedule1').html(); //$('.contbox.schedule2').append(scl); } }); $(window).on('load',function(){ setsize(); movepos(); }); $(window).on('resize',function () { setsize(); movepos(); }); $(window).on('scroll',function () { //setsize(); }); $(window).on('orientationchange', function(){ setsize(); }); function setsize(){ if(!$('#head.home').length){ var hsize = $("#head").outerHeight(); $("#container").css("padding-top",hsize+"px"); } $('#philosophy li > div').matchHeight(); } //他ページよりのアンカーリンク function movepos(){ var mrg = $("#head").outerHeight(); 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); }