1jQuery(function($){ 2 3 /* ----------------------------------------------- 4 breakpoint 5 -------------------------------------------------- */ 6 const breakpoint = window.matchMedia("(max-width: 500px)"); 7 8 /* ----------------------------------------------- 9 UA 10 -------------------------------------------------- */ 11 function userAgent() { 12 const ua = navigator.userAgent; 13 if (ua.indexOf('iPhone') != -1 || ua.indexOf('iPod') != -1 || ua.indexOf('Android') != -1 && ua.indexOf('Mobile') != -1) { 14 //sp 15 $('body').addClass('is-view-sp'); 16 } else if (ua.indexOf('iPad') != -1 || ua.indexOf('Android') != -1) { 17 //tab 18 $('body').addClass('is-view-tab'); 19 } else { 20 // pc 21 $('body').addClass('is-view-pc'); 22 } 23 } 24 25 // IE 26 function userAgentIE() { 27 const ua = window.navigator.userAgent.toLowerCase(); 28 const uaVersion = window.navigator.appVersion.toLowerCase(); 29 //ie 30 if (ua.indexOf('msie') != -1 || ua.indexOf('trident') !== -1) { 31 $('body').addClass('is-view-ie'); 32 } 33 } 34 35 $(function(){ 36 userAgent(); 37 userAgentIE(); 38 }); 39 40 41 /* ----------------------------------------------- 42 ãã³ãã¼ã¬ã¼ã¡ãã¥ã¼ 43 -------------------------------------------------- */ 44 $('#js-buttonHamburger, .header__closeBtn').click(function (){ 45 // ã¹ã¯ãã¼ã«ä½ç½® 46 if($('body').hasClass('is-drawerActive')){ 47 $('body').removeClass('is-drawerActive').css('top',0 + 'px'); 48 window.scrollTo( 0 , scrollPos ); 49 }else{ 50 scrollPos = $(window).scrollTop(); 51 $('body').addClass('is-drawerActive').css('top',-scrollPos + 'px'); 52 } 53 54 // å±é 55 if ($(this).attr('aria-expanded') == 'false') { 56 //éããã¨ã 57 $(this).attr('aria-expanded', true); 58 $(".header__closeBtn").attr('aria-expanded', true); 59 $('#js-drawer').attr('aria-hidden', false); 60 } else { 61 //éããã¨ã 62 $(this).attr('aria-expanded', false); 63 $(".header__closeBtn").attr('aria-expanded', false); 64 $('#js-drawer').attr('aria-hidden', true); 65 }; 66 67 // ãã³ãã¼ã¬ã¼å ã®æå¾ã®ãªã³ã¯ããã¿ã³ãéãããéãããã¼ã¤ãã³ã 68 $('#js-drawer a:last, #js-drawer button:last').focusout(function(e) { 69 $('#js-buttonHamburger').attr('aria-expanded', false); 70 $('#js-drawer').attr('aria-hidden', true); 71 $('body').removeClass('is-drawerActive'); 72 }); 73 }); 74 75 76 /* ----------------------------------------------- 77 ãã¼ã¸æä¸é¨ã¸æ»ããªã³ã¯ 78 -------------------------------------------------- */ 79 $("#js-pageTop").hide(); 80 $(window).scroll(function () { 81 if ($(this).scrollTop() > 100) { 82 $('#js-pageTop').fadeIn(); 83 } else { 84 $('#js-pageTop').fadeOut(); 85 } 86 }); 87 $('#js-pageTop a').click(function () { 88 $('body,html').animate({ 89 scrollTop: 0 90 }, 550); 91 $('a').first().focus();// æåã®ãªã³ã¯ã«ãã©ã¼ã«ã¹ãç§»ã 92 return false; 93 }); 94 95 96 97 /* ----------------------------------------------- 98 æå®ãªã³ã¯ã«å¥ã¿ãè¨å® 99 -------------------------------------------------- */ 100 $('a[href*="goobike.com/shop/client_8300450/showroom.html"]:not(.icon-none)').attr({target:"_blank"}).append('<svg class="icon icon-win _black" role="img" aria-label="æ°ããã¿ãã§éã"><use xlink:href="#icon-win"></use></svg>'); 101 102 103 /* ----------------------------------------------- 104 ãããã¯ã¨ãã£ã¿ã®ã³ã³ãã¼ãã³ãã«ã¯ã©ã¹ä»ä¸ 105 -------------------------------------------------- */ 106 //1段éä¸ãã 107 $(".wp-post h2").addClass("heading3"); 108 $(".wp-post h3").addClass("heading4"); 109 $(".wp-post h4").addClass("heading5"); 110 $(".wp-post h5").addClass("heading6"); 111 $(".wp-post h6").addClass("heading7"); 112 $(".wp-post ul").addClass("list-bullet"); 113 $(".wp-post ol").addClass("list-number"); 114 115 116 /* ----------------------------------------------- 117 Webã¢ã¯ã»ã·ããªãã£ï¼ã¢ã¤ã³ã³ 118 -------------------------------------------------- */ 119 $("a[href$=pdf]") 120 .not('.icon-none, .wp-block-file__button') 121 .append('<svg class="icon icon-file icon-pdf" role="img" aria-label="PDFãã¡ã¤ã«"><use xlink:href="#icon-pdf"></use></svg>'); 122 $("a[href$=doc], a[href$=docx]") 123 .not('.icon-none') 124 .append('<svg class="icon icon-file icon-doc" role="img" aria-label="Wordãã¡ã¤ã«"><use xlink:href="#icon-doc"></use></svg>'); 125 $("a[href$=xls], a[href$=xlsx]") 126 .not('.icon-none') 127 .append('<svg class="icon icon-file icon-xls" role="img" aria-label="Excelãã¡ã¤ã«"><use xlink:href="#icon-xls"></use></svg>'); 128 $("a[href$=ppt], a[href$=pptx]") 129 .not('.icon-none') 130 .append('<svg class="icon icon-file icon-ppt" role="img" aria-label="PPTãã¡ã¤ã«"><use xlink:href="#icon-ppt"></use></svg>'); 131 $(".content a[target='_blank']") 132 .not("a[href$=pdf], a[href$=xls], a[href$=xlsx], a[href$=doc], a[href$=docx], .icon-none, .share__nav__link, .others-item__link") 133 .append('<svg class="icon icon-win" role="img" aria-label="æ°ããã¿ãã§éã"><use xlink:href="#icon-win"></use></svg>'); 134 135 136 137 /* ----------------------------------------------- 138 ã¹ã ã¼ã¹ã¹ã¯ãã¼ã« 139 -------------------------------------------------- */ 140 var headerHight = $('.header').height(); //ãããã®é«ã
141 // alert(headerHight); //debug 142 $('a[href^="#"]').on('click', function () { 143 var href = $(this).attr("href"); 144 var target = $(href == "#" || href == "" ? 'html' : href); 145 var position = target.offset().top-headerHight; //ãããã®é«ãåä½ç½®ãããã 146 $("html, body").animate({scrollTop: position}, 550, "swing"); 147 return false; 148 }); 149 150 151 /* ----------------------------------------------- 152 Webã¢ã¯ã»ã·ããªãã£ï¼ãã³ã³ãã³ãã¸ã¹ããããã®ãã©ã¼ã«ã¹ç§»å 153 -------------------------------------------------- */ 154 $('.skipLink').on('click', function() { 155 $('#container a, #container button').eq(0).focus(); 156 }); 157 158 159 /* ----------------------------------------------- 160 ãªã³ã¯ã«ã«ã¬ã³ãã¯ã©ã¹ä»ä¸ 161 -------------------------------------------------- */ 162 // ãªã³ã¯ã«ã«ã¬ã³ãã¯ã©ã¹ä»ä¸ 163 $('a').not('.zoomImg').each(function(){ 164 if(this.href == location.href) $(this).addClass("is-current"); 165 }); 166 // gnavã®aria-label 167 var url = window.location.pathname; 168 $('.gnav li a[href="'+url+'"]').attr('aria-label','page'); 169 170 171 /* ----------------------------------------------- 172 ã¯ã©ã¹ä»ä¸ 173 -------------------------------------------------- */ 174 // ããã¿å ãªã³ã¯ 175 $('.footer-link__nav__item a').addClass('footer-link__nav__link'); 176 177 // top fittingãªã³ã¯ 178 $('.fitting-area__block, .others-item__link').hover( 179 function () { 180 $(this).find('.btn-arrow').addClass('hover'); 181 }, 182 function () { 183 $(this).find('.btn-arrow').removeClass('hover'); 184 } 185 ); 186 187 // ã«ã¼ãåãªã³ã¯ 188 $('.entry-card__item__link').hover( 189 function () { 190 $(this).find('.btn-arrow').addClass('hover'); 191 }, 192 function () { 193 $(this).find('.btn-arrow').removeClass('hover'); 194 } 195 ); 196 197 // ã³ã³ã¿ã¯ãã¨ãªã¢ 198 $('.contactArea-txt').hover( 199 function () { 200 $(this).closest('.contactArea').addClass('hover'); 201 }, 202 function () { 203 $(this).closest('.contactArea').removeClass('hover'); 204 } 205 ); 206 207 208 /* ----------------------------------------------- 209 ã¢ã¤ã³ã³ä»ä¸ 210 -------------------------------------------------- */ 211 //btn-arrow 212 $('.btn-arrow, .btn-band').append('<svg class="arrow1"><use xlink:href="#arrow1"></use></svg>'); 213 214 //[SP]header menu link 215 if (breakpoint.matches) { 216 $('.header__drawer-item__link').append('<svg class="arrow1"><use xlink:href="#arrow1"></use></svg>'); 217 } 218 219 220 /* ----------------------------------------------- 221 ã«ãã´ãªå夿´ 222 -------------------------------------------------- */ 223 /*if($('body').hasClass('home') || $('body').hasClass('post-type-archive-news')){ 224 $(".entry-list__item__category").each(function(i) { 225 //var hasClassName = $(this).attr('class'); 226 //console.log(hasClassName); 227 if($(this).hasClass('cat_partsland_takamatsu') || $(this).hasClass('cat_reparts_takamatsu')){ 228 $(this).text("髿¾åº"); 229 } else if($(this).hasClass('cat_partsland_matsuyama') || $(this).hasClass('cat_reparts_matsuyama')){ 230 $(this).text("æ¾å±±åº"); 231 } 232 }); 233 }*/ 234 235 236 /* ----------------------------------------------- 237 ã«ãã´ãªçµãè¾¼ã¿æã«è¨äºããªãå ´å 238 -------------------------------------------------- */ 239 if($("body").hasClass("archive") && $("body").hasClass("tax-news_category")) { 240 var breadcrumbCat = $("#breadcrumb li:nth-child(2)").text(); 241 if(breadcrumbCat == ''){ 242 $('#breadcrumb li:nth-child(2) a').attr('href', '/news/').text('ãç¥ãã'); 243 } 244 } else if($("body").hasClass("archive") && $("body").hasClass("tax-product_category")) { 245 var breadcrumbCat = $("#breadcrumb li:nth-child(2)").text(); 246 if(breadcrumbCat == ''){ 247 $('#breadcrumb li:nth-child(2) a').attr('href', '/product/').text('ååæ å ±'); 248 } 249 } 250 251 252 /* ----------------------------------------------- 253 ã¿ãå ãªã³ã¯ 254 -------------------------------------------------- */ 255 $(window).on('load', function() { 256 var nowUrl = location.href; 257 if(nowUrl.match('tab=')){ 258 //åå¾ããURLããæ å ±åå¾ 259 var params = nowUrl.split("?"); 260 var selectInfo = params[1].split("&"); 261 var selectTab = selectInfo[0]; 262 var selectAnchor = selectInfo[1];
263 //*ã¿ã 264 var selectTabInfo = selectTab.split("="); 265 var selectTabName = selectTabInfo[1]; 266 //*ã¢ã³ã«ã¼ãªã³ã¯ 267 var selectAnchorInfo = selectAnchor.split("="); 268 var selectAnchorName = selectAnchorInfo[1]; 269 270 //ã¿ãåãæ¿ã 271 $('.tab').removeClass('is-active'); 272 $('.panel').removeClass('is-show'); 273 var tabNo = '#tab' + selectTabName; 274 var panelNo = '#panel' + selectTabName; 275 $(tabNo).addClass('is-active'); 276 $(panelNo).addClass('is-show'); 277 278 //ã¢ã³ã«ã¼ãªã³ã¯ç§»å 279 var selectAnchorPosition = $('#'+ selectAnchorName).offset().top - 30; 280 if (breakpoint.matches) { 281 var selectAnchorPosition = selectAnchorPosition - 70; 282 } 283 $('body,html').animate({scrollTop:selectAnchorPosition}, 700, 'swing'); 284 } 285 }); 286 287 288 289 /* ----------------------------------------------- 290 FAQã®ã¢ã³ã¼ãã£ãªã³ 291 -------------------------------------------------- */ 292 if(document.URL.match(/faq/)){ 293 $('html').attr('itemscope itemtype="https://schema.org/FAQPage"'); 294 }; 295 $(".faq__item > dt > h3 > button, .faq__item > dt > button").on("click", function() { 296 $(this).closest('dt').next().slideToggle(); 297 if($(this).find('.faq__item--toggle').text() === 'ï¼'){ 298 $(this).find('.faq__item--toggle').text('â'); 299 $(this).find('.faq__item--toggle').attr('title', 'ä¸èº«ãéãã'); 300 $(this).attr('aria-expanded', true); 301 $(this).closest('dt').next('dd').attr('aria-hidden', false); 302 } else { 303 $(this).find('.faq__item--toggle').text('ï¼'); 304 $(this).find('.faq__item--toggle').attr('title', 'ä¸èº«ãéã'); 305 $(this).attr('aria-expanded', false); 306 $(this).closest('dt').next('dd').attr('aria-hidden', true); 307 } 308 }); 309 310 311 /* ----------------------------------------------- 312 .acListã®ã¢ã³ã¼ãã£ãªã³ 313 -------------------------------------------------- */ 314 $(".acList__item > button").on("click", function() { 315 $(this).next().slideToggle(); 316 if($(this).hasClass('show')){ 317 $(this).removeClass('show'); 318 $(this).attr('title', '詳細ãéã'); 319 $(this).attr('aria-expanded', false); 320 $(this).next('.acList__item__inner').attr('aria-hidden', true); 321 } else { 322 $(this).addClass('show'); 323 $(this).attr('title', '詳細ãéãã'); 324 $(this).attr('aria-expanded', true); 325 $(this).next('.acList__item__inner').attr('aria-hidden', false); 326 } 327 }); 328 329 330 331 /* ----------------------------------------------- 332 ã¢ã¼ã«ã¤ããã¼ã¸ã®è¦åºãã¬ãã«èª¿æ´ 333 -------------------------------------------------- */ 334 $('.post-type-archive article h3').replaceWith(function() { 335 return $("<h2>", { 336 class: this.className, 337 html: $(this).html() 338 }); 339 }); 340 341 342 /* ----------------------------------------------- 343 Googleãããã®ã¬ã¹ãã³ã·ãå 344 -------------------------------------------------- */ 345 //è¨äºè©³ç´°ãã¼ã¸ã®ã¿ 346 if($('body').hasClass('single')){ 347 $("iframe[src^='https://www.google.com/maps/']") 348 .attr('title','Googleããã') 349 .wrap('<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper"></div></figure>'); 350 } 351 352 // iframe frameborderåé¤ 353 $('iframe').removeAttr('frameborder'); 354 355 356 /* ----------------------------------------------- 357 Luminous 358 -------------------------------------------------- */ 359 $.when( 360 // å ã«ã¨ã³ããªå ã®ç»åãªã³ã¯ã« .zoomImg ä»ä¸ 361 $('.content__main a[href$=jpg], .content__main a[href$=png], .content__main a[href$=gif], .content__main a[href$=webp]').addClass('zoomImg') 362 ).done(function() { 363 // ã®ã£ã©ãªã¼è¡¨ç¤ºãã¤ãã£ãã·ã§ã³è¡¨ç¤º 364 const luminousOpts = { 365 caption: (trigger) => { 366 return trigger.querySelector("img").getAttribute("alt"); 367 } 368 }; 369 // ç¢å°ãã¼ã§ç»ååãæ¿ã 370 const galleryOpts = { 371 arrowNavigation: true 372 }; 373 374 // LuminousGallery ã®å¼æ°æå® 375 new LuminousGallery( 376 document.querySelectorAll(".zoomImg"), //ãããã¢ãã表示ããaè¦ç´ 377 galleryOpts, //ã®ã£ã©ãªã¼è¡¨ç¤ºã®ãªãã·ã§ã³ 378 luminousOpts //ãªãã·ã§ã³ 379 ); 380 }); 381 382 383 /* ----------------------------------------------- 384 åãåãããã©ã¼ã 385 -------------------------------------------------- */ 386 // æ°åãã¼ãã¼ã 387 $('.contactForm input[name="zip"], .contactForm input[name="tel"], .contactForm input[name="phone"], .contactForm input[name="fax"]').not("[type=hidden], body.confirm").attr('type', 'tel'); 388 // aria屿§ 389 $('.contactForm .required dd input, .contactForm .required dd textarea').attr('aria-required', 'true'); 390 $('.addrHint').attr('aria-describedby', 'addrHint'); 391 // ã¨ã©ã¼ã¡ãã»ã¼ã¸ 392 $(".form__error") 393 .attr({"role":"alert","aria-live":"assertive"}) 394 .prepend('<svg class="icon"><use xlink:href="#icon-notice"></use></svg>');; 395 $('.form__error').each(function(span) { 396 $(this).prev('input, textarea').addClass('form__error__input'); 397 }); 398 // ã¨ã©ã¼ç»é¢ã§æåã®ã¨ã©ã¼é ç®ã«ãã©ã¼ã«ã¹ 399 if(document.URL.match(/error/)){ 400 $('.form__error__input').first().focus(); 401 }; 402 403 404 /* ----------------------------------------------- 405 Webã¢ã¯ã»ã·ããªãã£ï¼ãã®ä»ã³ã³ãã¼ãã³ã 406 -------------------------------------------------- */ 407 // ãã¿ã³ 408 $('a.wp-block-button__link').attr({"role":"button"}); 409 410 411 /* ----------------------------------------------- 412 ãµã¼ãã¹ - ãã£ããã£ã³ã° 413 -------------------------------------------------- */ 414 if(document.URL.match(/fitting/)){ 415 /* SPã¹ã©ã¤ãã¼ */ 416 if (breakpoint.matches) { 417 const mySwiperFitting = new Swiper ('.service-fitting-slider', { 418 slidesPerView: '1.02', //ä½æè¡¨ç¤ºããã 419 spaceBetween: 30, //ä½ç½ï¼pxï¼ 420 speed: 500, // ã¹ã©ã¤ãã¢ãã¡ã¼ã·ã§ã³ã®ã¹ãã¼ãï¼ããªç§ï¼ 421 centeredSlides : false, //ã¢ã¯ãã£ããªã¹ã©ã¤ããä¸å¤®ã«ããã 422 //ã¹ã¯ãã¼ã«ãã¼è¡¨ç¤ºã®è¨å® 423 scrollbar: { 424 el: '.service-fitting-slider__scrollbar', //è¦ç´ ã®æå® 425 }, 426 }); 427 } 428 429 /* ã¿ãåãæ¿ãã«ããç»å夿´ */ 430 function switchTab() { 431 if($('.tabA').hasClass('is-active')){ 432 $('.elem013__img__item').addClass('_shoei').removeClass('_arai'); 433 } else if ($('.tabB').hasClass('is-active')){ 434 $('.elem013__img__item').addClass('_arai').removeClass('_shoei'); 435 } 436 } 437 $(window).on('load', function() { 438 switchTab(); 439 });
440 $(".tab-item").on("click", function() { 441 switchTab(); 442 }); 443 } 444 445 /* ----------------------------------------------- 446 ãµã¼ãã¹ - æ¡ç¨æ å ±ï¼ã¹ã©ã¤ãã¼ 447 -------------------------------------------------- */ 448 if(document.URL.match(/recruit/)){ 449 const mySwiperDelimiter = new Swiper ('.delimiter-slider', { 450 loop: true, 451 slidesPerView: '2', 452 spaceBetween: 0, 453 centeredSlides : true, 454 allowTouchMove: false, 455 breakpoints: { 456 351: { 457 slidesPerView: '2.3', 458 }, 459 401: { 460 slidesPerView: '2.5', 461 }, 462 501: { 463 slidesPerView: '5.2', 464 } 465 } 466 }); 467 } 468 469}); //jquery 470 471 472 /* ----------------------------------------------- 473 ã¿ãåãæ¿ã 474 -------------------------------------------------- */ 475 document.addEventListener('DOMContentLoaded', function(){ 476 // ã¿ãã«å¯¾ãã¦ã¯ãªãã¯ã¤ãã³ããé©ç¨ 477 const tabs = document.getElementsByClassName('tab'); 478 for(let i = 0; i < tabs.length; i++) { 479 tabs[i].addEventListener('click', tabSwitch); 480 } 481 // ã¿ããã¯ãªãã¯ããã¨å®è¡ãã颿° 482 function tabSwitch(){ 483 // 弿°ã§æå®ããã»ã¬ã¯ã¿ã¼ã¨ä¸è´ããç´è¿ã®ç¥å è¦ç´ ãåå¾ 484 const ancestorEle = this.closest('.tab-panel'); 485 // ã¿ãã®classã®å¤ã夿´ 486 ancestorEle.getElementsByClassName('is-active')[0].classList.remove('is-active'); 487 this.classList.add('is-active'); 488 // ã³ã³ãã³ãã®classã®å¤ã夿´ 489 ancestorEle.getElementsByClassName('is-show')[0].classList.remove('is-show'); 490 const groupTabs = ancestorEle.getElementsByClassName('tab'); 491 const arrayTabs = Array.prototype.slice.call(groupTabs); 492 var index = arrayTabs.indexOf(this); 493 ancestorEle.getElementsByClassName('panel')[index].classList.add('is-show'); 494 }; 495 }); 496 497 498 /* ----------------------------------------------- 499 追å¾ããã¼ãCookieã§ä¸å®æéé表示㫠500 -------------------------------------------------- */ 501 var period = 1000 * 60 * 1; // ä¿åæé:60å(1000ããªç§ * 60ç§ * 60å) IF:30æ¥(1000ããªç§ * 60ç§ * 60å * 24æé * 30æ¥) 502 // localStorageã§ä½¿ç¨ããkeyå 503 var storage_key = 'ad_close'; // åºåããã¼ç®¡çã§ä½¿ç¨ããå¤ 504 var storage_period_key = 'ad_close_time'; // ä¿åæéã§ä½¿ç¨ããå¤ 505 506 var ad = document.getElementById('ad-bnr'); 507 508 // ä¿åæéã®å¤ãä¿åããã¦ããå ´å 509 if(localStorage.getItem(storage_period_key) !== null) { 510 // ä¿åããã¦ããå¤ã¨ç¾å¨ã®å¤ã®å·®ãè¦ã¦ãæéãéãã¦ããªããç¢ºèª 511 var df = Date.now() - parseFloat(localStorage.getItem(storage_period_key)); 512 if(df > period) { 513 // æéãéãã¦ããå ´åã¯localStorageã®å¤ãåé¤ 514 localStorage.removeItem(storage_key); 515 localStorage.removeItem(storage_period_key); 516 } 517 } 518 // åºåããã¼ç®¡çã®å¤ãä¿åããã¦ããªãå ´åã¯ããã¼è¡¨ç¤º 519 if(localStorage.getItem(storage_key) === null) { 520 ad.classList.add('is-show'); 521 } 522 document.getElementById('ad-bnr_close').addEventListener('click', ad_close, false); 523 // åºåããã¼ãéããéã®å¦ç 524 function ad_close() { 525 ad.classList.remove('is-show'); 526 // localStorageã«å¿ è¦ãªå¤ãä¿å 527 localStorage.setItem(storage_key, 'on'); 528 localStorage.setItem(storage_period_key, Date.now()); 529 }
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.