$(function(){ var topBtn=$('#pageTop'); topBtn.hide(); $(window).scroll(function (){ if($(this).scrollTop() > 400){ topBtn.fadeIn(); }else{ topBtn.fadeOut(); }}); topBtn.click(function (){ $('body,html').stop().animate({ scrollTop: 0 }, 1000); return false; }); $('.js-tocList a[href^="#"]').click(function(){ var href=$(this).attr("href"); var target=$(href=="#"||href=="" ? 'html':href); var position=target.offset().top; var winW=$(window).width(); var devW=767; if(winW <=devW){ var nav=$('#gnav'); var navH=nav.outerHeight(true); position=target.offset().top - navH; } $("html, body").animate({scrollTop:position}, 500); return false; }); var sPos=0; var header=$('#header'); var headerH=header.outerHeight(true); var timer=false; setNavPosition(true); $(window).scroll(function (){ setNavPosition(); }); $('.js-tab').each(function(){ var list=$(this).find('.js-tabList >li'); var cont=$(this).find('.js-tabCont'); var hash=location.hash; if(hash&&$(cont).filter(hash).size() > 0){ location.hash=''; list.removeClass('active'); list.find('a[href="'+hash+'"]').closest('li').addClass('active'); $(cont).filter(hash).show(); }else{ var idx=$(list).index($(this).find('.js-tabList >li.active')); if(idx >=0){ list.eq(idx).addClass('active'); cont.eq(idx).fadeIn(); }else{ list.eq(0).addClass('active'); cont.eq(0).fadeIn(); }} $(list).click(function(){ var idx=$(list).index(this); if(cont.eq(idx).size() > 0){ list.removeClass('active'); $(this).addClass('active'); cont.hide(); cont.eq(idx).fadeIn(); } return false; }); }); function setNavPosition(flg){ var winW=$(window).width(); var devW=767; var nav=$('#gnav'); if(flg==true) sPos=scroll; if(winW <=devW){ var navH=nav.outerHeight(true); var scroll=$(window).scrollTop(); if(scroll <=headerH){ if(scroll > 78){ $(nav).css("top", 0 + "px"); }else{ $(nav).css('position', 'relative'); $(header).css('margin-bottom', 0 + "px"); } $('#container').css('padding-top', 0); }else{ $(nav).css('position', 'fixed'); $(nav).css("top", 0 + "px"); $('#container').css('padding-top', navH); }}else{ $(nav).css('position', 'relative'); $(nav).css("top", 0 + "px"); $(header).css('margin-bottom', 0 + "px"); $('#container').css('padding-top', 0); }} $('.js-accordion').each(function(){ var target=$(this).children('dt'); $(target).click(function(){ var $this=$(this); $($this.next()).stop().slideToggle(function(){ $this.toggleClass('open'); }); }); }); $(document).on('click', '.js-accordion-next', function(){ $(this).toggleClass('active'); $(this).next().slideToggle(); }); $('#articleListPickup').slick({ infinite: true, slidesToShow: 2, slidesToScroll: 1, responsive: [ { breakpoint: 767, settings: { slidesToShow: 1, centerMode: true, centerPadding: '60px' }}, ] }); $('#eventListPickup').slick({ infinite: true, slidesToShow: 2, slidesToScroll: 1, responsive: [ { breakpoint: 767, settings: { slidesToShow: 1, centerMode: true, centerPadding: '60px' }}, ] }); $('.js-btnSelect').click(function(){ var target=$(this).data('attr'); if($(target).size() > 0) $(target).fadeIn(); return false; }); $('.popClose').click(function(){ $('._fullPop').fadeOut(); return false; }); $('._radioBtn.releaseRadio').on('click', function(event){ event.preventDefault(); var $input=$(this).find('input'); $input.prop('checked', !$input.prop('checked')); }); $('.js-datepicker input').each(function(){ $(this).attr('readonly',true); var datepicker=$(this).datepicker({ format: "yyyy/m/d(D)", language: 'ja', autoclose: true, startDate: '-1y', todayHighlight: true, clearBtn: true, maxViewMode: 0 }); $(this).next().on('click', function(){ datepicker.datepicker('show'); }); }); $('.js-datepickerEvent input').each(function(){ $(this).attr('readonly',true); var datepicker=$(this).datepicker({ format: "yyyy/m/d", language: 'ja', autoclose: true, startDate: '-1y', todayHighlight: true, clearBtn: true, maxViewMode: 0 }); $(this).next().on('click', function(){ datepicker.datepicker('show'); }); }); $('.js-datepickerStart input').change(function(){ if(!$('.js-datepickerEnd input').val()){ $('.js-datepickerEnd input').val($('.js-datepickerStart input').val()); }}); $('.js-searchReset').on('click', function(){ var form=$(this).closest('form'); $(form).find("textarea, :text, select").val("").end().find(":checked").prop("checked", false); $(".js-spotCond ._check").hide(); $(".select-genre").show(); }); if($('#main').size() > 0){ var mainPos=$('#main').offset().top; $(window).scroll(function(){ if($(this).scrollTop() > mainPos){ $('#spShareBtn').addClass('show'); }else{ $('#spShareBtn').removeClass('show'); }}); } $('.articleIn table').each(function(){ var height=$(this).height(); var scrollBar=20; $(this).css({ 'height': 'auto', 'border-collapse': 'separate', }); $(this).wrap('
'); $(this).closest('.js-scrollTbl').height(height+scrollBar); }); $('.js-tocAcc').each(function(){ tocAccoudion(this); }); function tocAccoudion(self){ var toc=$(self).closest('#toc'); var isOpen=$(toc).hasClass('open'); if(isOpen){ $(self).html('[開く]'); }else{ $(self).html('[閉じる]'); }} $(document).on('click', '.js-tocAcc', function(){ var toc=$(this).closest('#toc'); $(toc).toggleClass('open'); $(toc).find('.js-tocList').slideToggle(); tocAccoudion(this); return false; }); }); $(function(){ if(!isPhone()) return; $('span[data-action=call]').each(function(){ var $ele=$(this); $ele.wrap(''); }); $('.js-autoConvTel').each(function(){ var str=$(this).html(); $(this).html(convertTelLink(str)); }); }); function isPhone(){ return (navigator.userAgent.indexOf('iPhone') > 0||navigator.userAgent.indexOf('Android') > 0); } function convertTelLink(str){ var phone_array=str.match(/\+?[0-9]+[\-\x20]?[0-9]+[\-\x20]?[0-9]+[\-\x20]?[0-9]+/g); var cursor=0; for(var i=0; phone_array!=null&&i < phone_array.length; i++){ var tmp=phone_array[i]; tmp=tmp.replace(/[\-\x20]/g, ''); if(tmp.length < 10||tmp.length > 12){ continue; } var tag_a='' + phone_array[i] + ''; var start=str.indexOf(phone_array[i], cursor); str=str.slice(0, start) + tag_a + str.slice(start + phone_array[i].length); cursor=start + tag_a.length; } return str; } $(function(){ if(isPhone()){ $('input[type="file"]').each(function(){ $(this).attr('accept', 'image/*'); }); } $(document).on('change', 'form input[type="file"]', function(e){ var file=e.target.files[0], reader=new FileReader(), preview=$(this).closest('td').find('.preview'); t=this; $(this).closest('td').find('.mw-wp-form_file, .mw-wp-form_image').remove(); if(file.type.indexOf("image") < 0){ preview.empty(); preview.append(''+file.name+''); preview.append('削除'); return false; } reader.onload=(function(file){ return function(e){ preview.empty(); preview.append($('').attr({ src: e.target.result, width: "200px", class: "preview", title: file.name, style: "margin-top:10px", })); preview.append('削除'); };})(file); reader.readAsDataURL(file); }); $(document).on('click', '._deleteFile', function(){ var file=$(this).closest('td').find('input[type="file"]'); file.val(''); var id=$(file).attr('id'); var name=$(file).attr('name'); $(file).replaceWith(file); $(this).closest('td').find('.mw-wp-form_file, .mw-wp-form_image').remove(); $(this).closest('div').empty(); return false; }); $('.mw-wp-form_file, .mw-wp-form_image').each(function(){ var obj=this; var preview=$(obj).closest('td').find('.preview'); var link=$(obj).find('a'); var file=$(link).attr('href'); var type=file.split('.'); var type=type[type.length - 1].toLowerCase(); if(type=='jpg'||type=='jpeg'||type=='gif'||type=='png'){ preview.append($('').attr({ src: file, width: "200px", class: "preview", style: "margin-top:10px", })); preview.append('削除'); }else{ preview.append('アップロードファイル'); preview.append('削除'); } if($(this).closest('td').find('input[type="file"]').size()==0){ $(this).closest('td').find('._fileInp').remove(); $(this).closest('td').find('._deleteFile').remove(); } link.remove(); }); }); function getUrlVars(){ var vars={}, max=0, hash="", array=""; var url=window.location.search; hash=url.slice(1).split('&'); max=hash.length; if(!url) return false; for (var i=0; i < max; i++){ array=hash[i].split('='); vars[array[0]]=array[1]; } return vars; } function addUrlQuery(base, key, val){ var query=getUrlVars(); if(!query) query={}; query[key]=val; if(query['kw']) query['kw']=decodeURI(query['kw']); var qstr=decodeURIComponent($.param(query)); location.href=base+'?'+qstr; return false; }; function heightLine(){ this.className="heightLine"; this.parentClassName="heightLineParent" reg=new RegExp(this.className+"-([a-zA-Z0-9-_]+)", "i"); objCN=new Array(); var objAll=document.getElementsByTagName ? document.getElementsByTagName("*"):document.all; for(var i=0; i < objAll.length; i++){ var eltClass=(typeof objAll[i].className==='string')? objAll[i].className.split(/\s+/):[]; for(var j=0; j < eltClass.length; j++){ if(eltClass[j]==this.className){ if(!objCN["main CN"]) objCN["main CN"]=new Array(); objCN["main CN"].push(objAll[i]); break; }else if(eltClass[j]==this.parentClassName){ if(!objCN["parent CN"]) objCN["parent CN"]=new Array(); objCN["parent CN"].push(objAll[i]); break; }else if(eltClass[j].match(reg)){ var OCN=eltClass[j].match(reg) if(!objCN[OCN]) objCN[OCN]=new Array(); objCN[OCN].push(objAll[i]); break; }} } var e=document.createElement("div"); var s=document.createTextNode("S"); e.appendChild(s); e.style.visibility="hidden" e.style.position="absolute" e.style.top="0" document.body.appendChild(e); var defHeight=e.offsetHeight; changeBoxSize=function(){ for(var key in objCN){ if(objCN.hasOwnProperty(key)){ if(key=="parent CN"){ for(var i=0 ; iCCN[j].offsetHeight?max_height:CCN[j].offsetHeight; }} for(var j=0 ; jobjCN[key][i].offsetHeight?max_height:objCN[key][i].offsetHeight; } for(var i=0 ; ii?e+i:i}function a(t,e){return Math.round((/%/.test(t)?("x"===e?E.width():o())/100:1)*parseInt(t,10))}function s(t,e){return t.get("photo")||t.get("photoRegex").test(e)}function l(t,e){return t.get("retinaUrl")&&i.devicePixelRatio>1?e.replace(t.get("photoRegex"),t.get("retinaSuffix")):e}function d(t){"contains"in x[0]&&!x[0].contains(t.target)&&t.target!==v[0]&&(t.stopPropagation(),x.focus())}function c(t){c.str!==t&&(x.add(v).removeClass(c.str).addClass(t),c.str=t)}function g(e){A=0,e&&e!==!1&&"nofollow"!==e?(W=t("."+te).filter(function(){var i=t.data(this,Y),n=new r(this,i);return n.get("rel")===e}),A=W.index(_.el),-1===A&&(W=W.add(_.el),A=W.length-1)):W=t(_.el)}function u(i){t(e).trigger(i),ae.triggerHandler(i)}function f(i){var o;if(!G){if(o=t(i).data(Y),_=new r(i,o),g(_.get("rel")),!U){U=$=!0,c(_.get("className")),x.css({visibility:"hidden",display:"block",opacity:""}),I=n(se,"LoadedContent","width:0; height:0; overflow:hidden; visibility:hidden"),b.css({width:"",height:""}).append(I),j=T.height()+k.height()+b.outerHeight(!0)-b.height(),D=C.width()+H.width()+b.outerWidth(!0)-b.width(),N=I.outerHeight(!0),z=I.outerWidth(!0);var h=a(_.get("initialWidth"),"x"),s=a(_.get("initialHeight"),"y"),l=_.get("maxWidth"),f=_.get("maxHeight");_.w=Math.max((l!==!1?Math.min(h,a(l,"x")):h)-z-D,0),_.h=Math.max((f!==!1?Math.min(s,a(f,"y")):s)-N-j,0),I.css({width:"",height:_.h}),J.position(),u(ee),_.get("onOpen"),O.add(F).hide(),x.focus(),_.get("trapFocus")&&e.addEventListener&&(e.addEventListener("focus",d,!0),ae.one(re,function(){e.removeEventListener("focus",d,!0)})),_.get("returnFocus")&&ae.one(re,function(){t(_.el).focus()})}var p=parseFloat(_.get("opacity"));v.css({opacity:p===p?p:"",cursor:_.get("overlayClose")?"pointer":"",visibility:"visible"}).show(),_.get("closeButton")?B.html(_.get("close")).appendTo(b):B.appendTo("
"),w()}}function p(){x||(V=!1,E=t(i),x=n(se).attr({id:Y,"class":t.support.opacity===!1?Z+"IE":"",role:"dialog",tabindex:"-1"}).hide(),v=n(se,"Overlay").hide(),L=t([n(se,"LoadingOverlay")[0],n(se,"LoadingGraphic")[0]]),y=n(se,"Wrapper"),b=n(se,"Content").append(F=n(se,"Title"),R=n(se,"Current"),P=t('',nextArrow:'',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(e,t){return i('