1/* ===================================== 2 header_scroll_toggle 3===================================== */ 4 5//jQuery(document).ready(function () { 6// var defPos = 0; 7// jQuery(window).scroll(function () { 8// var currentPos = jQuery(this).scrollTop(); 9// if (currentPos > defPos) { 10// if (jQuery(window).scrollTop() >= 150) { 11// var hh = jQuery("#header").height(); 12// jQuery("#header").css("top", "-" + hh + "px"); 13// } 14// } else { 15// jQuery("#header").css("top", 0 + "px"); 16// } 17// defPos = currentPos; 18// }); 19// 20//}); 21 22 23/* ===================================== 24 Header Structure EX 25===================================== */ 26 27$(document).ready(function() { 28 checkUA(); 29 checkBrowzer(); 30 var ww = document.body.clientWidth; 31 $(".g_nav li.menu-item-has-children").click(function(e) { 32 $(this).toggleClass("hover"); 33 }); 34 35 36 $(".toggleMenu").click(function(e) { 37 e.preventDefault(); 38 $(this).toggleClass("active"); 39 40 if ($('body').hasClass("nav-Opened")) { 41 $('body').removeClass("nav-Opened"); 42 $("#navigation.header__main-cointainer").fadeOut(); 43 } else { 44 $('body').addClass("nav-Opened"); 45 $("#navigation.header__main-cointainer").fadeIn(); 46 } 47 }); 48 49 50 $(".header__wrap a").click(function(e) { 51 $('body').removeClass("nav-Opened"); 52 //$("#navigation .header__main-cointainer").fadeOut("500"); 53 $(".toggleMenu").removeClass("active"); 54 }); 55 $(".g_nav > li > span").each(function() { 56 $(this).addClass("parent"); 57 }) 58 adjustMenu(ww); 59}); 60 61 62function adjustMenu(ww) { 63 if (ww <= 767) { 64 if (!$(".toggleMenu").hasClass("active")) { 65 $("#navigation.header__main-cointainer").hide(); 66 } else { 67 $("#navigation.header__main-cointainer").css("display", "block"); 68 } 69 $(".g_nav>li").unbind('mouseenter mouseleave'); 70 $(".g_nav li span.parent").unbind("click"); 71 $(".g_nav li span.parent").click(function(e) { 72 e.preventDefault(); 73 $(this).parent("li").toggleClass('hover'); 74 }); 75 76 } else { //768ÃÆÃ¤ÃâûÃâÃÂ¥ÃÆÃ¤ÃâøÃ⦠=PC,̢̮̣ââ¬à ¡ÃâÃÂ¿ÃÆÃ£Ãâ ââ¬â¢Ã¢ââ‰â¬Å̮̣Ãâ ââ¬â¢ÃâÃÂ¬ÃÆÃ£Ãâ ââ¬â¢Ãâ ââ¬â¢ÃÆÃ£Ãâ ââ¬â¢Ãâ¹Ã¢â¬ 77 $(".toggleMenu img").css("display", "none"); 78 $("#navigation.header__main-cointainer").removeAttr("style"); 79 $(".g_nav>li").unbind("hover"); 80 $(".g_nav>li").hover(function() { 81 $(this).addClass('hover'); 82 }, function() { 83 $(this).removeClass('hover'); 84 }); 85 } 86} 87 88 89 90$("#header .g_nav li a").click(function() { 91 if ($(window).width() < 768) { 92 $(".toggleMenu").removeClass("active"); 93 $("#navigation.header__main-cointainer").fadeOut("500"); 94 $('body').removeClass("nav-Opened"); 95 } 96}); 97 98 99 100 101 102$(window).bind('resize orientationchange', function() { 103 //ww = document.body.clientWidth; 104 ww = window.innerWidth; 105 adjustMenu(ww); 106}); 107 108 109 110 111$("#header .g_nav .sub-menu a").click(function() { 112 $("#header .g_nav > li").removeClass("hover"); 113 //$("#header .g_nav > li > dl").fadeOut("500"); 114}); 115$("#header .g_nav > li > a, #header .g_nav > li > span").hover(function() { 116 $("#header .g_nav .sub-menu").css("display", "block"); 117}); 118 119function checkUA() { 120 ua = window.navigator.userAgent; 121 if( (ua.indexOf('Android') > 0 && ua.indexOf('Mobile') > 0) || ua.indexOf('iPod') > 0 || (ua.indexOf('iPhone') > 0 && ua.indexOf('iPad') == -1)) { 122 ua_type = 'SP'; 123 if(ua.indexOf('Android') > 0 && ua.indexOf('Mobile') > 0){ 124 var win_w = jQuery(window).width(); 125 if(win_w >= 768){ 126 ua_type = 'TB'; 127 } 128 } 129 } else if(ua.indexOf('Android') > 0 || ua.indexOf('iPad') > 0){ 130 ua_type = 'TB'; 131 if(ua.indexOf('Android') > 0){ 132 var win_w = jQuery(window).width(); 133 if(win_w <= 767){ 134 ua_type = 'SP'; 135 } 136 } 137 } else { 138 ua_type = 'PC'; 139 } 140 141 if(ua_type == 'TB'){ 142 jQuery('body').addClass('tablet'); 143 }else{ 144 jQuery('body').removeClass('tablet'); 145 } 146 147 if(ua_type == 'PC'){ 148 jQuery('body').addClass('desktop'); 149 }else{ 150 jQuery('body').removeClass('desktop'); 151 } 152} 153 154function checkBrowzer() { 155 if(ua.indexOf('WebKit') > 0){ 156 isWebkit = true; 157 } 158 if(ua.indexOf('Firefox') > 0){ 159 isFF = true; 160 } 161 if(ua.indexOf('MSIE') > 0){ 162 isIE = true; 163 } 164} 165 166function isTabs(){ 167 var userAgent = window.navigator.userAgent.toLowerCase(); 168 if((navigator.userAgent.indexOf('Android') > 0 && navigator.userAgent.indexOf('Mobile') == -1) || navigator.userAgent.indexOf('A1_07') > 0 || navigator.userAgent.indexOf('SC-01C') > 0 || navigator.userAgent.indexOf('iPad') > 0){ 169 return true; 170 }else{ 171 return false;
172 } 173} 174 175 176/* ------------------------------------- 177iPhoneã§ç»é¢ãæ»ã£ãéã«ã¡ãã¥ã¼ãæ®ãç¾è±¡ãåé¿ 178------------------------------------- */ 179 180jQuery("#header #g_nav li a").click(function(){ 181 if(jQuery(window).width() < 768) { 182 jQuery(".toggle-menu").removeClass("active"); 183 jQuery("#header #g_nav").fadeOut("500"); 184 } 185}); 186 187 188/* ------------------------------------- 189ãã«ãã¦ã³ã«ã«ã¼ã½ã«ãç½®ãã¦ããã¨ãªã³ã¯ãã¯ãªãã¯ããå¾ãæ¶ããªãç¾è±¡ãåé¿ 190------------------------------------- */ 191 192jQuery("#header #g_nav > li dl a").click(function () { 193 jQuery("#header #g_nav > li").removeClass("hover"); 194 jQuery(".tablet #header #g_nav > li > dl").hide(); 195}); 196 197jQuery("#header #g_nav > li > a, #header #g_nav > li > span").hover(function () { 198 jQuery(".desktop #header #g_nav > li > dl").css("display", "block"); 199}); 200 201jQuery(function() { 202 if(jQuery(window).width()>767) { 203 jQuery( '.tablet #header #g_nav > li:has(dl)' ).doubleTapToGo(); 204 } 205}); 206 207/* 208 By Osvaldas Valutis, www.osvaldas.info 209 Available for use under the MIT License 210*/ 211;(function( $, window, document, undefined ) 212{ 213 $.fn.doubleTapToGo = function( params ) 214 { 215 if( !( 'ontouchstart' in window ) && 216 !navigator.msMaxTouchPoints && 217 !navigator.userAgent.toLowerCase().match( /windows phone os 7/i ) ) return false; 218 219 this.each( function() 220 { 221 var curItem = false; 222 223 jQuery( this ).on( 'click', function( e ) 224 { 225 var item = jQuery( this ); 226 if( item[ 0 ] != curItem[ 0 ] ) 227 { 228 e.preventDefault(); 229 curItem = item; 230 } 231 }); 232 233 jQuery( document ).on( 'click touchstart MSPointerDown', function( e ) 234 { 235 var resetItem = true, 236 parents = jQuery( e.target ).parents(); 237 238 for( var i = 0; i < parents.length; i++ ) 239 if( parents[ i ] == curItem[ 0 ] ) 240 resetItem = false; 241 242 if( resetItem ) 243 curItem = false; 244 }); 245 }); 246 return this; 247 }; 248})( jQuery, window, document ); 249 250 251/* ===================================== 252 Anchor links 253===================================== */ 254 255 256 257/* ===================================== 258 Footer 259===================================== */ 260 261jQuery(function () { 262 var defPos = 0; 263 jQuery(window).scroll(function () { 264 var currentPos = jQuery(this).scrollTop(); 265 var scrollHeight = document.body.scrollHeight; 266 var availHeight = window.screen.availHeight; 267 if(currentPos != defPos){ // prevent Ie bug 268 if (currentPos > defPos) { 269 if (jQuery(window).scrollTop() >= 300) { 270 jQuery(".fixed_box").css("bottom", 0 + "px"); 271 } 272 } else { 273 jQuery(".fixed_box").css("bottom", -150 + "px"); 274 } 275 } 276     if(scrollHeight - availHeight - currentPos < 0){ 277 jQuery(".fixed_box").css("bottom", 0 + "px"); 278 } 279 defPos = currentPos; 280 }); 281}); 282 283 284/* ===================================== 285 heightLine 286===================================== */ 287 288new function(){ 289 290 function heightLine(){ 291 292 this.className="heightLine"; 293 this.parentClassName="heightLineParent"; 294 reg = new RegExp(this.className+"-([a-zA-Z0-9-_]+)", "i"); 295 objCN =new Array(); 296 var objAll = document.getElementsByTagName ? document.getElementsByTagName("*") : document.all; 297 for(var i = 0; i < objAll.length; i++) { 298 var eltClass = objAll[i].className.split(/\s+/); 299 for(var j = 0; j < eltClass.length; j++) { 300 if(eltClass[j] == this.className) { 301 if(!objCN["main CN"]) objCN["main CN"] = new Array(); 302 objCN["main CN"].push(objAll[i]); 303 break; 304 }else if(eltClass[j] == this.parentClassName){ 305 if(!objCN["parent CN"]) objCN["parent CN"] = new Array(); 306 objCN["parent CN"].push(objAll[i]); 307 break; 308 }else if(eltClass[j].match(reg)){ 309 var OCN = eltClass[j].match(reg) 310 if(!objCN[OCN]) objCN[OCN]=new Array(); 311 objCN[OCN].push(objAll[i]); 312 break; 313 } 314 } 315 } 316 317 //check font size 318 var e = document.createElement("div"); 319 var s = document.createTextNode("S"); 320 e.appendChild(s); 321 e.style.visibility="hidden" 322 e.style.position="absolute" 323 e.style.top="0" 324 document.body.appendChild(e); 325 var defHeight = e.offsetHeight; 326 327 changeBoxSize = function(){ 328 for(var key in objCN){ 329 if (objCN.hasOwnProperty(key)) { 330 //parent type 331 if(key == "parent CN"){ 332 for(var i=0 ; i<objCN[key].length ; i++){ 333 var max_height=0; 334 var CCN = objCN[key][i].childNodes; 335 for(var j=0 ; j<CCN.length ; j++){ 336 if(CCN[j] && CCN[j].nodeType == 1){ 337 CCN[j].style.height="auto"; 338 max_height = max_height>CCN[j].offsetHeight?max_height:CCN[j].offsetHeight; 339 } 340 } 341 for(var j=0 ; j<CCN.length ; j++){ 342 if(CCN[j].style){ 343 var stylea = CCN[j].currentStyle || document.defaultView.getComputedStyle(CCN[j], ''); 344 var newheight = max_height; 345 if(stylea.paddingTop)newheight -= stylea.paddingTop.replace("px",""); 346 if(stylea.paddingBottom)newheight -= stylea.paddingBottom.replace("px",""); 347 if(stylea.borderTopWidth && stylea.borderTopWidth != "medium")newheight-= stylea.borderTopWidth.replace("px",""); 348 if(stylea.borderBottomWidth && stylea.borderBottomWidth != "medium")newheight-= stylea.borderBottomWidth.replace("px",""); 349 CCN[j].style.height =newheight+"px"; 350 } 351 } 352 } 353 }else{ 354 var max_height=0; 355 for(var i=0 ; i<objCN[key].length ; i++){ 356 objCN[key][i].style.height="auto"; 357 max_height = max_height>objCN[key][i].offsetHeight?max_height:objCN[key][i].offsetHeight; 358 } 359 for(var i=0 ; i<objCN[key].length ; i++){ 360 if(objCN[key][i].style){ 361 var stylea = objCN[key][i].currentStyle || document.defaultView.getComputedStyle(objCN[key][i], ''); 362 var newheight = max_height; 363 if(stylea.paddingTop)newheight-= stylea.paddingTop.replace("px",""); 364 if(stylea.paddingBottom)newheight-= stylea.paddingBottom.replace("px",""); 365 if(stylea.borderTopWidth && stylea.borderTopWidth != "medium")newheight-= stylea.borderTopWidth.replace("px","") 366 if(stylea.borderBottomWidth && stylea.borderBottomWidth != "medium")newheight-= stylea.borderBottomWidth.replace("px",""); 367 objCN[key][i].style.height =newheight+"px"; 368 } 369 } 370 } 371 } 372 } 373 } 374 375 checkBoxSize = function(){ 376 if(defHeight != e.offsetHeight){ 377 changeBoxSize(); 378 defHeight= e.offsetHeight; 379 } 380 } 381 changeBoxSize(); 382 setInterval(checkBoxSize,1000) 383 window.onresize=changeBoxSize; 384 } 385 386 function addEvent(elm,listener,fn){ 387 try{ 388 elm.addEventListener(listener,fn,false); 389 }catch(e){ 390 elm.attachEvent("on"+listener,fn); 391 } 392 } 393 addEvent(window,"load",heightLine); 394} 395 396 397/* ===================================== 398 accordion 399===================================== */ 400 401jQuery(function($) { 402 jQuery('.accordion p').click(function(){ 403 if(jQuery(this).next('ul').is(':visible')) { 404 jQuery(this).next('ul').slideUp(300); 405 jQuery(this).removeClass('acv_open'); 406 } else { 407 jQuery('.accordion ul').slideUp(); 408 jQuery('.accordion').find('p').removeClass('acv_open'); 409 jQuery(this).next('ul').slideDown(300); 410 jQuery(this).addClass('acv_open'); 411 } 412 }); 413}); 414 415 416/* ===================================== 417 ã ãåãåãã 418===================================== */ 419if (jQuery('.wpcf7').length > 0) { 420 jQuery(function() { 421 var inquiryForm_message = jQuery('.inquiryForm_message'); 422 var entry_form = jQuery('.entry-form'); 423 424 jQuery(document).ready(function() { 425 var local_href = window.location.href; 426 var url; 427 if (local_href.indexOf('/contact/') > -1) { 428 jQuery('body').addClass('contact'); 429 } 430 }); 431 432 var $s = jQuery('.wpcf7-confirm'); 433 var $c = jQuery('.wpcf7-checkbox.wpcf7-validates-as-required'); 434 var $t = jQuery('.wpcf7-validates-as-required:not(.wpcf7-checkbox)'); 435 436 if (inquiryForm_message.length > 0) { 437 function toggleSubmitClass(flag) { 438 $s.prop('disabled', flag); 439 if (flag) { 440 $s.addClass('disabled').removeClass('abled').attr({ 'value': 'å¿ é é ç®ãå ¥åãã¦ãã ãã' }); 441 } else { 442 $s.addClass('abled').removeClass('disabled').attr({ 'value': 'å ¥åå 容ã確èªãã' }); 443 } 444 } 445 } 446 447 if (entry_form.length > 0) { 448 function toggleSubmitClass(flag) { 449 $s.prop('disabled', flag); 450 if (flag) { 451 $s.addClass('disabled').removeClass('abled').attr({ 'value': 'å¿ é é ç®ãå ¥åãã¦ãã ãã' }); 452 } else { 453 $s.addClass('abled').removeClass('disabled').attr({ 'value': 'éä¿¡å 容ã®ç¢ºèª' }); 454 } 455 } 456 } 457 458 function ckFlag() { 459 var controlFields = $t.map(function(i, e) { return jQuery(e).val() || null }).length == $t.length; 460 var controlCheckbox = $c.map(function(i, e) { return jQuery(e).find(".wpcf7-list-item input[type=checkbox]:checked").length >= 1 || null }).length == $c.length; 461 var flag = (controlFields == true && controlCheckbox == true) ? true : false;
462 toggleSubmitClass(!flag); 463 } 464 ckFlag(); 465 $c.on('click', ckFlag); 466 $t.on('keydown keyup keypress change', ckFlag); 467 }); 468 469 jQuery(function() { 470 var $confirm_btn = jQuery('.wpcf7-confirm'); 471 var $back_btn = jQuery('.wpcf7-back'); 472 var $submit_btn = jQuery('.wpcf7-submit'); 473 var inquiryForm_message = jQuery('.inquiryForm_message'); 474 var entry_form = jQuery('.entry-form'); 475 476 function confirmBtn() { 477 jQuery(".inquiryFormTable").addClass('verified_table'); 478 479 if (jQuery(".wpcf7-confirm").hasClass("abled")) { 480 jQuery(".inquiryFormTable").addClass('confirm_table'); 481 jQuery(".wpcf7-form").addClass('.custom-wpcf7c-confirmed'); 482 var t = setTimeout(function() { 483 if (jQuery(".wpcf7-form").hasClass("custom-wpcf7c-confirmed")) { 484 jQuery(".custom-wpcf7c-confirmed input[type='text'], .custom-wpcf7c-confirmed input[type='tel'], .custom-wpcf7c-confirmed input[type='email'], .custom-wpcf7c-confirmed input[type='date'], .custom-wpcf7c-confirmed select, .custom-wpcf7c-confirmed textarea, .custom-wpcf7c-confirmed input:checkbox:checked, .custom-wpcf7c-confirmed input:radio:checked").each(function() { 485 var val = jQuery(this).val(); 486 jQuery(this).parent().append('<span class="result_txt">' + val + '</span>'); 487 }); 488 } 489 }, 2000) 490 } 491 } 492 $confirm_btn.on('click', confirmBtn); 493 494 function backBtn() { 495 jQuery(".inquiryFormTable").removeClass('confirm_table'); 496 jQuery(".wpcf7-form").removeClass('custom-wpcf7c-confirmed'); 497 jQuery(".result_txt").remove(); 498 } 499 $back_btn.on('click', backBtn); 500 501 function submitBtn() { 502 jQuery(".inquiryFormTable").css("display", "none"); 503 jQuery(".entry-form").css("display", "none"); 504 } 505 $submit_btn.on('click', submitBtn); 506 507 //prevent submit by using enter key on radios, checkboxs and dates 508 jQuery('.inquiryFormTable input[type="radio"], .inquiryFormTable input[type="checkbox"], .inquiryFormTable input[type="date"]').keydown(function(e) { 509 if (e.keyCode == 13) { 510 e.preventDefault(); 511 return false; 512 } 513 }); 514 515 }); 516 517 jQuery(document).ready(function() { 518 jQuery('.wpcf7-confirm').click(function(e) { 519 jQuery('html,body').animate({ scrollTop: jQuery('form').offset().top - 80 }, 'slow', null); 520 }); 521 }); 522 523 jQuery(document).ready(function() { 524 if (jQuery('.entry-form').length > 0) {} 525 jQuery('.entry-form .wpcf7c-btn-confirm').click(function(e) { 526 jQuery('html,body').animate({ scrollTop: jQuery('form').offset().top - 80 }, 'slow', null); 527 }); 528 }); 529} 530 531 532/* ===================================== 533ã«ã¹ã¿ã ã¤ãã³ãè¨æ¸¬ 534===================================== */ 535document.addEventListener('DOMContentLoaded', function () { 536 // data-evt屿§ãæå®ãããå¤ã®è¦ç´ ãåå¾ 537 const targetElements = document.querySelectorAll( 538 '[data-evt="é»è©±ã¿ãã"], [data-evt="WEBäºç´ã¿ãã"], [data-evt="ãåãåããã¿ãã"], [data-evt="LINEã¿ãã"], [data-evt="AIç¸è«ã¿ãã"], [data-evt="Instagramã¿ãã"]' 539 ); 540 541 542 targetElements.forEach(function (element) { 543 element.addEventListener('click', function () { 544 // data-evt屿§ã®å¤ãåå¾ 545 const eventType = element.getAttribute('data-evt'); 546 547 548 // GA4ã«ã«ã¹ã¿ã ã¤ãã³ããéä¿¡ 549 gtag('event', `${eventType}`, { 550 'event_category': eventType, // 屿§å¤ãã«ãã´ãªã¨ãã¦éä¿¡ 551 'event_label': eventType, // 屿§å¤ãã©ãã«ã¨ãã¦éä¿¡ 552 'value': 1 553 }); 554 }); 555 }); 556}); 557(function(jQuery){ 558 559 560 561 if(jQuery(".wpcf7c-elm-step1").length != 0) { 562 // 対象æã 563 564 jQuery(".wpcf7c-elm-step1").each(function(){ 565 // 親ã®ãã©ã¼ã ãæ¤ç´¢ 566 var parent = jQuery(this).parents("form"); 567 if(parent.attr("wpcf7c") == undefined) { 568 // elm-submitãsubmitãã¿ã³ã¸ãã»ãã 569 parent.find(".wpcf7-submit").addClass("wpcf7c-elm-step2").addClass("wpcf7c-force-hide"); 570 parent.find(".ajax-loader").addClass("wpcf7c-elm-step2").addClass("wpcf7c-force-hide"); 571 572 // ajaxç¨IDéé¿,å¦çæ¸ã¿ãã©ã°ã»ãã 573 var hidden_wpcf7 = parent.find("input[name=_wpcf7]"); 574 var _wpcf7 = hidden_wpcf7.val(); 575 parent.attr("wpcf7c", _wpcf7); 576 577 parent.attr("step", 1); 578 579 hidden_wpcf7.after('<input type="hidden" name="_wpcf7c" value="step1" />'); 580 581 //parent.find("input[name=_wpcf7]").val(""); 582 583 // ä¸è¦è¦ç´ é表示 584 parent.find(".wpcf7c-elm-step2").addClass("wpcf7c-force-hide"); 585 parent.find(".wpcf7c-elm-step3").addClass("wpcf7c-force-hide"); 586 parent.find(".wpcf7c-elm-step1").removeClass("wpcf7c-force-hide"); 587 588 // æ»ã£ã¦ç·¨éãã¿ã³æå 589 parent.find(".wpcf7c-btn-back").on("click", function(){ 590 wpcf7c_to_step1(parent, true); 591 return false;
592 }); 593 } 594 595 596 597 598 }); 599 600 601 602 } 603 604})(jQuery); 605 606var wpcf7c_to_step1 = function(parent, scroll){ 607 parent.find(".wpcf7c-conf").each(function(){ 608 // 親ãã©ã¼ã 609 var parent_form = jQuery(this).parents("form"); 610 611 jQuery(this).removeAttr("disabled").removeAttr("readonly").removeClass("wpcf7c-conf"); 612 613 }); 614 615 jQuery(".wpcf7c-conf-hidden").remove(); 616 617 parent.find(".wpcf7c-elm-step2").addClass("wpcf7c-force-hide"); 618 parent.find(".wpcf7c-elm-step3").addClass("wpcf7c-force-hide"); 619 parent.find(".wpcf7c-elm-step1").removeClass("wpcf7c-force-hide"); 620 621 parent.find("input[name=_wpcf7c]").val("step1"); 622 623 var responseOutput = parent.find('div.wpcf7-response-output'); 624 responseOutput.removeClass("wpcf7c-force-hide"); 625 responseOutput.removeClass("wpcf7-mail-sent-ng"); 626 if(scroll) { 627 // responseOutput.css("display", "none"); 628 responseOutput.addClass("wpcf7c-force-hide"); 629 } 630 631 parent.find(".ajax-loader").addClass("wpcf7c-elm-step2").addClass("wpcf7c-force-hide"); 632 633 // ã¹ã ã¼ãºã¹ã¯ãã¼ã« 634 if(scroll) { 635 // ã¹ã ã¼ãºã¹ã¯ãã¼ã« 636 setTimeout(function() { wpcf7c_scroll(parent.find("input[name=_wpcf7_unit_tag]").val()) }, 100); 637 } 638 639} 640 641 642var wpcf7c_step1 = function(unit_tag){ 643 // 確èªå®äº 644 645 // 対象ãã©ã¼ã æ¤ç´¢ 646 //var elm_unit_tag = jQuery.find("input[name=_wpcf7_unit_tag]"); 647 jQuery(jQuery.find("input[name=_wpcf7_unit_tag]")).each(function(){ 648 if(jQuery(this).val() == unit_tag) { 649 var parent = jQuery(this).parents("form"); 650 651 652 var responseOutput = parent.find('div.wpcf7-response-output'); 653 responseOutput.addClass("wpcf7c-force-hide"); 654 655 // 確èªç»é¢è¡¨ç¤º 656 // ããã¹ãã¨ãªã¢ã伸ã°ã 657 parent.find("textarea").each(function(){ 658 if(this.scrollHeight > this.offsetHeight){ 659 this.style.height = (this.scrollHeight + 10) + 'px'; 660 } 661 }); 662 parent.find("textarea").attr("readonly", true).addClass("wpcf7c-conf"); 663 parent.find("select").each(function(){ 664 jQuery(this).attr("readonly", true).attr("disabled", true).addClass("wpcf7c-conf"); 665 jQuery(this).after( 666 jQuery('<input type="hidden" />').attr("name", jQuery(this).attr("name")).val(jQuery(this).val()).addClass("wpcf7c-conf-hidden") 667 ); 668 }); 669 parent.find("input").each(function(){ 670 switch(jQuery(this).attr("type")) { 671 case "submit": 672 case "button": 673 case "hidden": 674 case "image": 675 // ãªã«ãããªã 676 break; 677 case "radio": 678 case "checkbox": 679 // 鏿ããã¦ãããã®ã ãå¯¾å¦ 680 jQuery(this).attr("readonly", true).attr("disabled", true).addClass("wpcf7c-conf"); 681 if(jQuery(this).is(":checked")) { 682 jQuery(this).after( 683 jQuery('<input type="hidden" />').attr("name", jQuery(this).attr("name")).val(jQuery(this).val()).addClass("wpcf7c-conf-hidden") 684 ); 685 } 686 break; 687 case "file": 688 jQuery(this).attr("readonly", true).addClass("wpcf7c-elm-step1").addClass("wpcf7c-force-hide"); 689 jQuery(this).after( 690 jQuery('<input type="text" />').attr("name", (jQuery(this).attr("name") + "_conf")).val(jQuery(this).val()).addClass("wpcf7c-conf-hidden").addClass("wpcf7c-conf").attr("readonly", true).attr("disabled", true) 691 ); 692 693 break; 694 default: 695 jQuery(this).attr("readonly", true).addClass("wpcf7c-conf"); 696 jQuery(this).after( 697 jQuery('<input type="hidden" />').attr("name", jQuery(this).attr("name")).val(jQuery(this).val()).addClass("wpcf7c-conf-hidden") 698 ); 699 break; 700 } 701 }); 702 703 // è¡¨ç¤ºåæ¿ 704 parent.find(".wpcf7c-elm-step1").addClass("wpcf7c-force-hide"); 705 parent.find(".wpcf7c-elm-step3").addClass("wpcf7c-force-hide"); 706 parent.find(".wpcf7c-elm-step2").removeClass("wpcf7c-force-hide"); 707 708 parent.find(".ajax-loader").removeClass("wpcf7c-force-hide"); 709 710 parent.find("input[name=_wpcf7c]").val("step2"); 711 712 // ã¹ã ã¼ãºã¹ã¯ãã¼ã« 713 setTimeout(function() { wpcf7c_scroll(unit_tag) }, 100); 714 715 716 } 717 }); 718} 719 720var wpcf7c_scroll = function(unit_tag) { 721 // ã¨ã©ã¼ã®æãªã©ã«ã¢ã³ã«ã¼ã¾ã§ã¹ã¯ãã¼ã« 722 jQuery(jQuery.find("input[name=_wpcf7_unit_tag]")).each(function(){ 723 if(jQuery(this).val() == unit_tag) { 724 var parent = jQuery(this).parents("form"); 725 var speed = 1000; 726 var position = parent.offset().top; 727 if(jQuery('.wpcf7c-anchor').length != 0) { 728 position = jQuery('.wpcf7c-anchor').offset().top; 729 } 730 jQuery("html, body").animate({scrollTop:position}, speed, "swing"); 731 } 732 }); 733} 734 735var wpcf7c_step2 = function(unit_tag){ 736 // 確èªå®äº 737 738 // 対象ãã©ã¼ã æ¤ç´¢ 739 //var elm_unit_tag = jQuery.find("input[name=_wpcf7_unit_tag]"); 740 jQuery(jQuery.find("input[name=_wpcf7_unit_tag]")).each(function(){ 741 if(jQuery(this).val() == unit_tag) { 742 var parent = jQuery(this).parents("form"); 743 744 745 var responseOutput = parent.find('div.wpcf7-response-output'); 746 responseOutput.removeClass("wpcf7c-force-hide"); 747 748 // step1ç¶æ ã®ç»é¢è¡¨ç¤º 749 wpcf7c_to_step1(parent); 750 751 // step3ã®è¦ç´ ãããã°ãããã«åãæ¿ãã 752 if(parent.find(".wpcf7c-elm-step3").length != 0) { 753 // è¡¨ç¤ºåæ¿ 754 parent.find(".wpcf7c-elm-step1").addClass("wpcf7c-force-hide"); 755 parent.find(".wpcf7c-elm-step2").addClass("wpcf7c-force-hide"); 756 parent.find(".wpcf7c-elm-step3").removeClass("wpcf7c-force-hide"); 757 } 758 759 760 } 761 }); 762} 763 764var wpcf7c_step2_error = function(unit_tag) { 765 jQuery(jQuery.find("input[name=_wpcf7_unit_tag]")).each(function(){ 766 if(jQuery(this).val() == unit_tag) { 767 var parent = jQuery(this).parents("form"); 768 769 var responseOutput = parent.find('div.wpcf7-response-output'); 770 responseOutput.removeClass("wpcf7c-force-hide"); 771 } 772 }); 773 774} 775 776 777document.addEventListener( 'wpcf7submit', function( event ) { 778 switch ( event.detail.status ) { 779 case 'wpcf7c_confirmed': 780 wpcf7c_step1(event.detail.unitTag); 781 break; 782 case 'mail_sent': 783 wpcf7c_step2(event.detail.unitTag); 784 break; 785 786 } 787}, false ); 788 789 790 791 792jQuery("body").on("click", "a[href*='#']:not([href='#']), a[xlink\\:href*='#']:not([xlink\\:href='#'])", function(e) { 793 "use strict"; 794 if (jQuery(this).hasClass("unsmooth")) return; 795 var hash = jQuery(this).attr('href'); 796 if (hash) { 797 hash = hash.replace(/^\.\//g, ""); 798 hash = hash.replace(location.pathname, ""); 799 hash = hash.replace(location.origin, ""); 800 hash = hash.replace("//" + location.host, ""); 801 } 802 803 if (hash.match(/^#/) && jQuery(hash).length > 0) { 804 e.preventDefault(); 805 e.stopPropagation(); 806 807 var target = jQuery(hash); 808 var scrollDuration = window.innerWidth < 767 ? 65 : 120; 809 scrollToTarget(target, scrollDuration); 810 return false;
811 } 812}); 813 814 815function scrollToTarget(targetElement, overPixels) { 816 817 if (overPixels === undefined) { 818 overPixels = 0; 819 } 820 821 if (targetElement.length > 0) { 822 $target = targetElement; 823 jQuery('html, body').animate({ 824 scrollTop: $target.offset().top - overPixels // Scroll to this location. 825 }, { 826 duration: 1000, 827 step: function(now, fx) { 828 829 var newOffset = $target.offset().top - overPixels; 830 if (fx.end !== newOffset) 831 fx.end = newOffset; 832 } 833 }); 834 } 835} 836 837 838 839 840jQuery(window).load(function() { 841 var $path = location.href; 842 var $index = $path.indexOf("#"); 843 var $sub = $path.substring($index); 844 if ($index != -1) { 845 846 var target = $($sub); 847 var offsetTop = target.offset().top; 848 if (jQuery(window).width() >= 768) { 849 jQuery('html,body').animate({ 850 scrollTop: offsetTop - 120 851 }, 500); 852 } else { 853 jQuery('html,body').animate({ 854 scrollTop: offsetTop - 65 855 }, 500); 856 } 857 } 858}); 859 860 861 862 863 864 865 866 867
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.