1/* global platform */ 2 3jQuery( function ( $ ) { 4 "use strict"; 5 6 /* ########## å ¨ãã¼ã¸å ±é ########## */ 7 8 const $window = $( window ); 9 const $body = $( 'body' ); 10 const $container = $( '.container' ); 11 const $alert = $( '#alert' ); 12 const $header = $( '#header' ); 13 const $gHeader = $( '#gHeader' ); 14 const $gNavMenu = $( '.gNav nav', $gHeader ); 15 const $commonForm = $( '#commonForm' ); 16 17 let isMobile = false; 18 let isSp = false; 19 let isTab = false; 20 let isGnavActive = false; 21 22 /* IE/mobile check */ 23 24 if ( platform.name === 'IE' ) { // IE 25 $body.addClass( 'ie' ); 26 } else if ( platform.os.family === 'iOS' || platform.os.family === 'Android' ) { // mobile device 27 $( 'html' ).addClass( 'mobile' ); 28 isMobile = true; 29 } else if ( platform.os.family === 'OS X' && typeof document.ontouchstart !== 'undefined' ) { // iPad 30 $( 'html' ).addClass( 'mobile' ); 31 isMobile = true; 32 } 33 34 /* media query */ 35 36 const mediaQuery = window.matchMedia( '(max-width: 750px)' ); 37 const mediaQueryTab = window.matchMedia('(min-width: 751px) and (max-width: 1310px)'); 38 39 function handleMediaChange( e ) { 40 if ( e.matches ) { 41 isSp = true; 42 } else { 43 isSp = false; 44 } 45 } 46 47 function handleMediaChangeTab(e) { 48 if (e.matches) { 49 isTab = true; 50 } else { 51 isTab = false; 52 } 53 } 54 55 mediaQuery.addEventListener( 'change', handleMediaChange ); 56 mediaQueryTab.addEventListener('change', handleMediaChangeTab); 57 58 handleMediaChange( mediaQuery ); 59 handleMediaChangeTab(mediaQueryTab); 60 61 // browser back 62 63 setTimeout(function(){ 64 $body.addClass( 'transitionReady' ); 65 }, 600); 66 67 // scroll 68 69 let scrollTop = 0; 70 let scrollTopBefor = 0; 71 72 $window.on( 'scroll', function () { 73 scrollTop = $window.scrollTop(); 74 75 // if ( !$body.hasClass('stopScroll') && scrollTop >= 1 && scrollTop < scrollTopBefor) { 76 // $body.addClass( 'fixHeader' ); 77 // } else { 78 // $body.removeClass( 'fixHeader' ); 79 // } 80 81 scrollTopBefor = scrollTop; 82 } ); 83 84 const observer = new IntersectionObserver( function ( entry ) { 85 let $this, method, value; 86 87 for ( let i = 0; i < entry.length; ++i ) { 88 $this = $( entry[i].target ); 89 method = $this.attr( 'data-iso-method' ); 90 value = $this.attr( 'data-iso-value' ); 91 92 if ( entry[i].isIntersecting ) { 93 switch ( method ) { 94 case 'addBodyClass': 95 $body.addClass( value ); 96 break; 97 case 'removeBodyClass': 98 $body.removeClass( value ); 99 break; 100 } 101 } else { 102 switch ( method ) { 103 case 'addBodyClass': 104 $body.removeClass( value ); 105 break; 106 case 'removeBodyClass': 107 $body.addClass( value ); 108 break; 109 } 110 } 111 } 112 } ); 113 114 //ãã¼ã¸å¤ã¢ã³ã«ã¼ 115 let headerHeight = $('#gHeader').outerHeight(); 116 let jump = headerHeight + convertPxToRem(100); 117 let urlHash = location.hash; 118 if(urlHash) { 119 $("body,html").scrollTop(0); 120 setTimeout(function () { 121 let target = $(urlHash); 122 let position = target.offset().top - jump; 123 $("body,html").stop().animate({ 124 scrollTop: position 125 }, 500); 126 }, 500); 127 } 128 function convertPxToRem(px) {//pxåä½ ããremåä½ ã«å¤æãã 129 var moveRem = getComputedStyle(document.documentElement).fontSize; 130 return px / parseFloat(moveRem); 131 } 132 133 $( '.iso ').each( function () { 134 observer.observe( this ); 135 } ); 136 137 // alert 138 139 if ( $alert.is (':visible' ) ) { 140 const $nmtAlert = $( '.nmtAlert' ); 141 const $ptAlert = $( '.ptAlert' ); 142 143 $window.on( 'resize', function () { 144 const alertHeight = $alert.outerHeight(); 145 146 $nmtAlert.css( 'margin-top', alertHeight * -1 ); 147 $ptAlert.css( 'padding-top', alertHeight ); 148 $gNavMenu.css( 'height', $window.innerHeight() - alertHeight ); 149 150 } ).trigger( 'resize' ); 151 } else { 152 $window.on( 'resize', function () { 153 $gNavMenu.css( 'height', $window.innerHeight() ); 154 155 } ).trigger( 'resize' ); 156 } 157 158 // gHeader 159 160 // $gHeader.clone().attr( 'id', 'gHeaderClone' ).addClass( 'clone' ).prependTo( $header ); 161 162 // gNav 163 164 let currentScrollTop; 165 166 $( document ).on( 'click', '.gHeader .btMenu', function ( ev ) { 167 ev.preventDefault(); 168 // const $currentGHeader = $( this ).closest( '.gHeader '); 169 170 if ( !isGnavActive ) {//éãã¦ãªãã£ãã 171 if ( isMobile ) { 172 currentScrollTop = $window.scrollTop();
173 $container.css( 'top', '-' + currentScrollTop + 'px' ); 174 $body.addClass( 'stopScroll' ); 175 } 176 // $currentGHeader.addClass( 'showGnav' ); 177 $gNavMenu.addClass('is-active'); 178 $('.btMenu').addClass('is-active'); 179 $('.gHeader').addClass('is-active'); 180 isGnavActive = true; 181 } else { 182 if ( isMobile ) { 183 $body.removeClass( 'stopScroll' ); 184 $container.css( 'top', 'auto' ); 185 $( document.scrollingElement ).scrollTop( currentScrollTop ); 186 } 187 // $currentGHeader.removeClass( 'showGnav' ); 188 $gNavMenu.removeClass('is-active'); 189 $('.btMenu').removeClass('is-active'); 190 $('.gHeader').removeClass('is-active'); 191 isGnavActive = false; 192 } 193 } ); 194 195 // gnav-menu position 196 if (isTab) { 197 gnavMenuPositionChange(); 198 function gnavMenuPositionChange() { 199 let headerHeight = $('#gHeader').outerHeight(); 200 let adjustedDetailHeight = headerHeight - 4; 201 let adjustedSearchHeight = headerHeight - 20; 202 $('.gHeader .detail').css({ top: adjustedDetailHeight }); 203 $('#search_body').css({ top: adjustedSearchHeight }); 204 } 205 $(window).on('resize orientationchange', function() { 206 gnavMenuPositionChange(); 207 }); 208 } 209 210 // gHeader click 211 $( document ).on( 'click', '.gHeader .summary', function ( ev ) { 212 if ( isSp ) { 213 ev.preventDefault(); 214 $( this ).toggleClass( 'active' ).next( '.detail' ).stop().slideToggle(); 215 } else if ( isTab ) { 216 ev.preventDefault(); 217 let $clickedSummary = $(this); 218 $clickedSummary.toggleClass('active').next('.detail').stop().slideToggle(); 219 $('.gHeader .summary').not($clickedSummary).removeClass('active').next('.detail').stop().slideUp(250); 220 } 221 }); 222 223 // gFooter 224 225 $( '#gFooter .navigation .summary' ).on( 'click', function ( ev ) { 226 if ( isSp ) { 227 ev.preventDefault(); 228 $( this ).toggleClass( 'active' ).next( '.detail' ).stop().slideToggle(); 229 } 230 } ); 231 232 // search_box 233 $('#search_trigger').on('click', function () { 234 if($('#search_body').is(':visible')) { 235 $('#search_body').stop(true,true).slideUp(250); 236 } else { 237 $('#search_body').stop(true,true).slideDown(250); 238 } 239 document.querySelector("#search_body input").focus(); 240 }); 241 242 searchWindowClose(); 243 $(window).resize(searchWindowClose); 244 245 function searchWindowClose() { 246 // ã¿ããããã¤ã¹ã§ãã¡ãã¥ã¼ä»¥å¤ã®æãã¿ããããæã«ã¹ã©ã¤ãã¢ãããã 247 // Androidã¿ãã¬ãã対ç 248 function isAndroidTablet() { 249 const userAgent = navigator.userAgent.toLowerCase(); 250 return userAgent.includes('android') && !userAgent.includes('mobile'); 251 } 252 253 if ($(window).width() >= 751) { 254 if (!isAndroidTablet()) { 255 $(document).on('click scroll', searchClick); 256 } 257 } else { 258 $(document).off('click scroll', searchClick); 259 } 260 } 261 262 function searchClick(e) { 263 const isInput = $(e.target).is('input') || $(e.target).closest('#search_body').is('input'); 264 265 if (!$(e.target).closest('#search_button, .btMenu, #search_body').length && 266 !isInput && $('#search_body').is(':visible')) { 267 $('#search_body').slideUp(250); 268 } 269 270 if (isTab && !$(e.target).closest('.gHeader .summary').length && $('.navDetail').is(':visible')) { 271 $('.navDetail').slideUp(250); 272 } 273 } 274 275 276 // form 277 278 $( '.commonFormLink button' ).on( 'click', function (ev) { 279 ev.preventDefault(); 280 281 $commonForm.addClass( 'active' ); 282 } ) 283 $( '.close', $commonForm ).on( 'click', function (ev) { 284 ev.preventDefault(); 285 286 $commonForm.removeClass( 'active' ); 287 } ) 288 $commonForm.on( 'transitionend', function () { 289 if ( $commonForm.hasClass( 'active' ) ) { 290 $commonForm.addClass( 'fixSpHeader' ); 291 } else { 292 $commonForm.removeClass( 'fixSpHeader' ); 293 } 294 } ); 295 296 // sticly table 297 298 const getElementBottom = function ( $el ) { 299 if ( $el.length === 0 ) { 300 return 0; 301 } 302 303 const el = $el.get( 0 ); 304 const style = window.getComputedStyle( el ); 305 if ( style.display === 'none' || style.visibility === 'hidden' ) { 306 return 0; 307 } 308 309 return Math.max( 0, el.getBoundingClientRect().bottom ); 310 }; 311 312 const getStickyTop = function ( $context ) { 313 if ( $context && $context.length > 0 ) { 314 const selectors = ( $context.attr( 'data-sticky-offset-selectors' ) || '' ).split( ',' ); 315 let stickyTop = 0; 316
317 selectors.forEach( function ( selector ) { 318 const trimmedSelector = selector.trim(); 319 320 if ( trimmedSelector !== '' ) { 321 stickyTop = Math.max( stickyTop, getElementBottom( $( trimmedSelector ).first() ) ); 322 } 323 } ); 324 325 if ( stickyTop > 0 ) { 326 return stickyTop; 327 } 328 } 329 330 const headerBottom = getElementBottom( $header ); 331 const gHeaderBottom = getElementBottom( $gHeader ); 332 return Math.max( headerBottom, gHeaderBottom ); 333 }; 334 335 const $table = $( 'table.sticky' ).filter( function () { 336 const $this = $( this ); 337 return !$this.hasClass( 'stickeyTable__table' ) && $this.closest( '.stickeyTable' ).length === 0; 338 } ); 339 340 if ( $table.length > 0 ) { 341 $table.each( function () { 342 const $this = $( this ); 343 const $cloneRow = $this.clone().addClass( 'headerRow' ); 344 $cloneRow.find( 'tbody' ).remove(); 345 $cloneRow.appendTo( $this.parent() ); 346 347 if ( $this.hasClass( 'stickyCol' ) ) { 348 const $cloneCol = $this.clone(); 349 $cloneCol.find( 'th, td' ).not( ':first-child' ).remove(); 350 const $cloneCol2 = $cloneCol.clone(); 351 $cloneCol2.find( 'tbody' ).remove(); 352 $cloneCol.addClass( 'headerCol' ).appendTo( $this.closest( '.tableWrapper ') ); 353 $cloneCol2.addClass( 'headerCol2' ).appendTo( $this.closest( '.tableWrapper ') ); 354 } 355 } ); 356 357 $window.on( 'resize', function () { 358 $table.filter( '.stickyCol' ).each( function () { 359 const $this = $( this ); 360 const $thisTr = $this.find( 'tbody tr' ); 361 const $cloneColTh = $this.closest( '.tableWrapper ').find( '.headerCol tbody th' ); 362 363 $thisTr.each( function () { 364 const $tr = $( this ); 365 const height = $tr.outerHeight(); 366 $cloneColTh.eq( $thisTr.index( $tr ) ).height( height ); 367 } ); 368 } ); 369 } ); 370 371 const updateStickyTableHeader = function () { 372 const scrollTop = $window.scrollTop(); 373 374 $table.each( function () { 375 const $this = $( this ); 376 const $wrapper = $this.closest( '.tableWrapper' ); 377 const $inner = $this.closest( '.inner01' ); 378 const $headerRow = $wrapper.find( '.headerRow' ); 379 const $headerCol2 = $wrapper.find( '.headerCol2' ); 380 const $fixedHeader = $headerRow.add( $headerCol2 ); 381 const thisHeight = $this.outerHeight(); 382 const thisTop = $this.offset().top; 383 const thisLeft = $this.offset().left; 384 const scrollLeft = $inner.length > 0 ? $inner.scrollLeft() : 0; 385 const theadHeight = $this.find( 'thead' ).outerHeight(); 386 const tableTop = getStickyTop(); 387 388 if ( scrollTop + tableTop > thisTop ) { 389 $fixedHeader.addClass( 'fixTop' ).css( { 390 top: tableTop 391 } ); 392 $headerRow.css( { 393 left: thisLeft - scrollLeft 394 } ); 395 $headerCol2.css( { 396 left: thisLeft 397 } ); 398 } else { 399 $fixedHeader.removeClass( 'fixTop' ).css( { 400 top: '0', 401 left: '' 402 } ); 403 } 404 if ( scrollTop + tableTop + theadHeight > thisTop + thisHeight ) { 405 $fixedHeader.addClass( 'fitBottom' ); 406 } else { 407 $fixedHeader.removeClass( 'fitBottom' ); 408 } 409 } ); 410 }; 411 412 $window.on( 'scroll', updateStickyTableHeader ).trigger( 'scroll' ); 413 $window.on( 'resize orientationchange', function () { 414 updateStickyTableHeader(); 415 $table.closest( '.inner01' ).trigger( 'scroll' ); 416 } ).trigger( 'resize' ); 417 418 $table.closest( '.inner01' ).on( 'scroll', function () { 419 const $this = $( this ); 420 const thisLeft = $this.offset().left; 421 const scrollLeft = $this.scrollLeft(); 422 423 $this.find( '.headerRow.fixTop' ).css( { 424 left: thisLeft - scrollLeft 425 } ); 426 $this.find( '.headerCol2.fixTop' ).css( { 427 left: thisLeft 428 } ); 429 } ); 430 } 431 432 const $stickeyTables = $( '.stickeyTable' ).add( $( '.stickeyTable__table' ).closest( '.tableWrapper' ) ); 433 434 if ( $stickeyTables.length > 0 ) { 435 const stickeyTableStates = []; 436 let stickeyTablesTicking = false; 437 438 const syncStickeyTableColumns = function ( state ) { 439 const widths = []; 440 const $rows = state.$table.find( 'tbody tr' ); 441 442 $rows.each( function () { 443 const $cells = $( this ).children( 'th, td' ); 444 445 if ( $cells.length >= 3 ) { 446 $cells.each( function ( index ) { 447 if ( index < 3 ) { 448 widths.push( this.getBoundingClientRect().width ); 449 } 450 } ); 451 return false;
452 } 453 } ); 454 455 if ( widths.length === 0 ) { 456 return; 457 } 458 459 while ( state.$colgroup.children().length < widths.length ) { 460 state.$colgroup.append( '<col>' ); 461 } 462 463 while ( state.$colgroup.children().length > widths.length ) { 464 state.$colgroup.children().last().remove(); 465 } 466 467 state.$colgroup.children( 'col' ).each( function ( index ) { 468 $( this ).css( 'width', widths[index] + 'px' ); 469 } ); 470 }; 471 472 const updateStickeyTable = function ( state ) { 473 const wrapperRect = state.wrapper.getBoundingClientRect(); 474 const innerRect = state.inner.getBoundingClientRect(); 475 const tableRect = state.table.getBoundingClientRect(); 476 const stickyTop = getStickyTop( state.$wrapper ); 477 const scrollLeft = state.inner.scrollLeft; 478 const headHeight = state.thead.getBoundingClientRect().height; 479 const tableHeight = state.$table.outerHeight(); 480 const tableTopInWrapper = tableRect.top - wrapperRect.top; 481 const isActive = tableRect.top <= stickyTop && tableRect.bottom > stickyTop; 482 const reachedBottom = tableRect.bottom <= stickyTop + headHeight; 483 484 state.$overlay.css( 'width', state.inner.clientWidth + 'px' ); 485 state.$overlayTable.css( { 486 width: state.table.scrollWidth + 'px', 487 transform: 'translateX(' + ( scrollLeft * -1 ) + 'px)' 488 } ); 489 490 if ( !isActive ) { 491 state.$overlay.removeClass( 'is-visible' ).css( { 492 position: 'absolute', 493 top: 0, 494 left: 0, 495 overflow: 'hidden', 496 pointerEvents: 'none', 497 visibility: 'hidden', 498 opacity: 0 499 } ); 500 state.$wrapper.removeClass( 'is-sticky-active' ); 501 state.$thead.css( 'visibility', '' ); 502 return; 503 } 504 505 state.$overlay.addClass( 'is-visible' ).css( { 506 overflow: 'visible', 507 pointerEvents: 'auto', 508 visibility: 'visible', 509 opacity: 1 510 } ); 511 state.$wrapper.addClass( 'is-sticky-active' ); 512 state.$thead.css( 'visibility', 'hidden' ); 513 514 if ( reachedBottom ) { 515 state.$overlay.css( { 516 position: 'absolute', 517 top: tableTopInWrapper + tableHeight - headHeight, 518 left: innerRect.left - wrapperRect.left 519 } ); 520 return; 521 } 522 523 state.$overlay.css( { 524 position: 'fixed', 525 top: stickyTop, 526 left: innerRect.left 527 } ); 528 }; 529 530 const updateStickeyTables = function () { 531 stickeyTableStates.forEach( function ( state ) { 532 syncStickeyTableColumns( state ); 533 updateStickeyTable( state ); 534 } ); 535 }; 536 537 const requestStickeyTablesUpdate = function () { 538 if ( stickeyTablesTicking ) { 539 return; 540 } 541 542 stickeyTablesTicking = true; 543 544 window.requestAnimationFrame( function () { 545 stickeyTablesTicking = false; 546 updateStickeyTables(); 547 } ); 548 }; 549 550 $stickeyTables.each( function () { 551 const $wrapper = $( this ); 552 if ( $wrapper.attr( 'data-sticky-ready' ) === 'true' ) { 553 return; 554 } 555 556 $wrapper.addClass( 'stickeyTable' ); 557 if ( window.getComputedStyle( $wrapper.get( 0 ) ).position === 'static' ) { 558 $wrapper.css( 'position', 'relative' ); 559 } 560 561 const $inner = $wrapper.find( '.inner01' ).first(); 562 const $tableEl = $wrapper.find( '.stickeyTable__table' ).first(); 563 const $tableTarget = $tableEl.length > 0 ? $tableEl : $wrapper.find( 'table' ).not( '.headerRow, .headerCol, .headerCol2' ).first(); 564 const $thead = $tableTarget.children( 'thead' ).first(); 565 566 if ( $inner.length === 0 || $tableTarget.length === 0 || $thead.length === 0 ) { 567 return; 568 } 569 570 const overlayTableClasses = ( $tableTarget.attr( 'class' ) || '' ) 571 .split( /\s+/ ) 572 .filter( function ( className ) { 573 return className !== '' && className !== 'stickeyTable__table'; 574 } ) 575 .concat( 'stickeyTable__overlayTable' ) 576 .join( ' ' ); 577 const $overlay = $( '<div class="stickeyTable__overlay" aria-hidden="true"></div>' ); 578 const $overlayTable = $( '<table></table>' ).attr( 'class', overlayTableClasses ); 579 const $colgroup = $( '<colgroup></colgroup>' ); 580 581 $overlay.css( { 582 top: 0, 583 left: 0, 584 zIndex: 20, 585 overflow: 'hidden', 586 pointerEvents: 'none', 587 visibility: 'hidden', 588 opacity: 0 589 } ); 590 $overlayTable.css( 'margin', 0 ); 591 592 $overlayTable.append( $colgroup ); 593 $overlayTable.append( $thead.clone() ); 594 $overlay.append( $overlayTable ); 595 $wrapper.prepend( $overlay ); 596 $wrapper.attr( 'data-sticky-ready', 'true' ); 597 598 stickeyTableStates.push( { 599 $wrapper, 600 wrapper: $wrapper.get( 0 ), 601 $inner, 602 inner: $inner.get( 0 ), 603 $table: $tableTarget, 604 table: $tableTarget.get( 0 ), 605 $thead, 606 thead: $thead.get( 0 ), 607 $overlay, 608 $overlayTable, 609 $colgroup 610 } ); 611 612 $inner.on( 'scroll', requestStickeyTablesUpdate ); 613 } ); 614 615 if ( stickeyTableStates.length > 0 ) { 616 $window.on( 'scroll resize orientationchange', requestStickeyTablesUpdate ); 617 618 if ( 'ResizeObserver' in window ) { 619 const stickeyTablesObserver = new ResizeObserver( requestStickeyTablesUpdate );
620 stickeyTableStates.forEach( function ( state ) { 621 stickeyTablesObserver.observe( state.inner ); 622 stickeyTablesObserver.observe( state.table ); 623 } ); 624 } 625 626 requestStickeyTablesUpdate(); 627 } 628 } 629 630 // window sizeãcssã«è¨å® 631 632 const setViewport = function () { 633 const vh = window.innerHeight * 0.01; 634 const vw = document.body.clientWidth * 0.01; 635 document.documentElement.style.setProperty( '--vh', vh + 'px' ); 636 document.documentElement.style.setProperty( '--vw', vw + 'px' ); 637 document.documentElement.style.setProperty( '--vmin', Math.min(vw, vh) + 'px' ); 638 }; 639 640 window.addEventListener( 'resize', function () { 641 requestAnimationFrame( setViewport ) 642 }, false); 643 644 window.addEventListener( 'load', function () { 645 requestAnimationFrame( setViewport ) 646 }, false ); 647 648 setTimeout( function () { 649 requestAnimationFrame( setViewport ) 650 setViewport(); 651 }, 500 ); 652 653 654 // misc 655 656 $( 'a[href^="#"]' ).not( '.noScroll' ).smoothScroll(); 657 658 $( 'a.youtube' ).magnificPopup({ 659 type: 'iframe', 660 removalDelay: 300, 661 mainClass: 'mfp-fade' 662 } ); 663 664 AOS.init( { 665 once: true 666 } ); 667 668 $( '.accordion .trigger' ).on( 'click', function ( ev ) { 669 ev.preventDefault(); 670 $( this ).toggleClass( 'active' ).next( '.target' ).stop().slideToggle(); 671 } ); 672 673 /* ########## TOP ########## */ 674 675 if ( $body.hasClass( 'home' ) ) { 676 677 // slick 678 const $homeBanner = $( '.banner .list' ); 679 const $homePickUp = $( '.case .pickup' ); 680 681 const slickHomeBanner = function () { 682 if ( !$homeBanner.hasClass( 'slick-initialized' ) ) { 683 $homeBanner.slick( { 684 arrows: true, 685 autoplay: true, 686 autoplaySpeed: 3000, 687 dots: true, 688 slidesToShow: 2, 689 slidesToScroll: 1, 690 responsive: [ 691 { 692 breakpoint: 750, 693 settings: { 694 arrows: false, 695 dots: true, 696 slidesToShow: 1, 697 slidesToScroll: 1 698 } 699 } 700 ] 701 } ); 702 703 } 704 }; 705 706 function handleMediaChangeHome( e ) { 707 if ( e.matches ) { 708 if ( $homeBanner.find( '.item' ).length > 1) { 709 slickHomeBanner() 710 } 711 712 if ( !$homePickUp.hasClass( 'slick-initialized' ) ) { 713 $homePickUp.slick( { 714 arrows: false, 715 centerMore: true, 716 dots: true 717 } ); 718 } 719 } else { 720 if ( $homeBanner.find( '.item' ).length > 2) { 721 slickHomeBanner() 722 } else if ( $homeBanner.hasClass( 'slick-initialized' ) ) { 723 $homeBanner.slick( 'unslick' ); 724 } 725 726 if ( $homePickUp.hasClass( 'slick-initialized' ) ) { 727 $homePickUp.slick( 'unslick' ); 728 } 729 } 730 } 731 732 mediaQuery.addEventListener( 'change', handleMediaChangeHome ); 733 734 handleMediaChangeHome( mediaQuery ); 735 } 736 737 /* ########## table header tooltip ########## */ 738 739 const $document = $( document ); 740 const helpSelector = '.tableWrapper table thead .check .help'; 741 const helpBalloonSelector = helpSelector + ' .balloon'; 742 const touchEventNamespace = 'touchstart.tableHeaderHelp'; 743 744 $document.off( touchEventNamespace ) 745 .on( touchEventNamespace, helpSelector, function ( ev ) { 746 if ( !isSp ) { 747 return; 748 } 749 750 ev.stopPropagation(); 751 752 const $this = $( this ); 753 $( helpSelector ).not( $this ).removeClass( 'active' ); 754 $this.toggleClass( 'active' ); 755 } ) 756 .on( touchEventNamespace, helpBalloonSelector, function ( ev ) { 757 if ( !isSp ) { 758 return; 759 } 760 761 ev.stopPropagation(); 762 } ) 763 .on( touchEventNamespace, function ( ev ) { 764 if ( !isSp ) { 765 return; 766 } 767 768 if ( $( ev.target ).closest( helpSelector + ', ' + helpBalloonSelector ).length === 0 ) { 769 $( helpSelector ).removeClass( 'active' ); 770 } 771 } ); 772 773 /* ########## faq ########## */ 774 775 if ( $body.hasClass( 'faq' ) ) { 776 const $checkbox = $( '.section .list dt input'); 777 778 $checkbox.filter( ':checked' ).closest( 'dt' ).next().show(); 779 780 $checkbox.on( 'change', function (ev) { 781 ev.preventDefault(); 782 const $this = $( this ); 783 784 if ( $this.is( ':checked' ) ) { 785 $checkbox.not( $this ).filter( ':checked' ).prop( 'checked', false ).closest( 'dt' ).next().stop().slideUp(); 786 $this.closest( 'dt' ).next().stop().slideDown(); 787 } else { 788 $this.closest( 'dt' ).next().stop().slideUp(); 789 } 790 791 } ); 792 } 793 794 /* ########## functions 2nd ########## */ 795 796 const $lightbox = $( '.lightbox' ); 797 798 if ( $lightbox.length > 0 ) { 799 800 const $imageViewer = $( '#imageViewer' ); 801 802 $( '.slider', $lightbox ).slick( 803 { 804 centerMode: true, 805 dots: true, 806 speed: 400, 807 variableWidth: true, 808 responsive: [ 809 { 810 breakpoint: 750, 811 settings: {
812 arrows: false, 813 centerMode: false, 814 variableWidth: false 815 } 816 } 817 ] 818 } 819 ).on( 'beforeChange' , function( event, slick, currentSlide, nextSlide ) { 820 if ( nextSlide === 0 ) { 821 $( slick.$slider[0] ).find( '.slick-current' ).next( '.slick-cloned' ).addClass( 'toCenter' ); 822 } 823 }).on( 'afterChange' , function( event, slick, currentSlide ) { 824 $( slick.$slider[0] ).find( '.toCenter' ).removeClass( 'toCenter' ); 825 }); 826 827 $( '.lightboxMenu a' ).on( 'click', function ( ev ) { 828 ev.preventDefault(); 829 830 const $this = $( this ); 831 const $parent = $this.closest( '.lightboxMenu' ); 832 const $siblings = $parent.find( 'a' ); 833 const $lightbox = $( '#' + $parent.attr( 'data-lb-id' ) ); 834 const $slider = $( '.slider', $lightbox ); 835 const index = $siblings.index( $this ); 836 837 $lightbox.fadeIn( function () { 838 $lightbox.addClass( 'active' ); 839 } ); 840 $slider.slick( 'slickGoTo', index, true ); 841 } ); 842 843 //æ©è½ï¼ããããã ã質åãã¿ã³ 844 $( '.js-lb-button' ).on( 'click', function () { 845 const $this = $( this ); 846 const index = $this.data('index');//lbã®indexçªå· 847 const $lightbox = $( '#lb01' ); 848 const $slider = $( '.slider', '#lb01' ); 849 850 $lightbox.fadeIn( function () { 851 $lightbox.addClass( 'active' ); 852 } ); 853 $slider.slick( 'slickGoTo', index, true ); 854 } ); 855 856 $( '.lbBg' ).on( 'click', function ( ev ) { 857 ev.preventDefault(); 858 859 $( this ).parent().fadeOut(); 860 } ); 861 862 $( '.close, .lbBg', $lightbox ).on( 'click', function ( ev ) { 863 ev.preventDefault(); 864 const $lightbox = $( this ).closest( '.lightbox' ); 865 866 $lightbox.fadeOut( function(){ 867 $lightbox.removeClass( 'active' ); 868 } ); 869 } ); 870 871 $( '.slider .zoom', $lightbox ).on( 'click', function ( ev ) { 872 ev.preventDefault(); 873 874 const src = $( this ).prev( 'img' ).attr( 'src' ); 875 876 $( '<img>' ).attr( 'src', src ).attr( 'id', 'zoomImage' ).appendTo( $imageViewer ); 877 $imageViewer.fadeIn(); 878 $("#zoomImage").imgViewer2(); 879 } ); 880 881 $( '.close', $imageViewer ).on( 'click', function ( ev ) { 882 ev.preventDefault(); 883 884 $imageViewer.fadeOut(function () { 885 $( 'img, .viewport', $imageViewer ).remove(); 886 }); 887 } ); 888 } 889 890 /* ########## app ########## */ 891 892 if ( $body.hasClass( 'app' ) ) { 893 const $recommendeddApp = $( '.recommendeddApp .list' ); 894 const $recommendeddAppItem = $recommendeddApp.find( '.item' ); 895 896 const slickApp = function () { 897 if ( !$recommendeddApp.hasClass( 'slick-initialized' ) ) { 898 $recommendeddApp.slick( { 899 arrows: true, 900 autoplay: true, 901 autoplaySpeed: 3000, 902 dots: true, 903 slidesToShow: 3, 904 slidesToScroll: 1, 905 responsive: [ 906 { 907 breakpoint: 750, 908 settings: { 909 arrows: false, 910 slidesToShow: 1 911 } 912 } 913 ] 914 } ).on( 'beforeChange', function ( event, slick, currentSlide, nextSlide ) { 915 const $pager = $( '.slick-dots li', $recommendeddApp ); 916 $pager.removeClass( 'showing' ); 917 let next01 = nextSlide + 1; 918 let next02 = nextSlide + 2; 919 if ( next01 === $pager.length ) { 920 next01 = 0; 921 } 922 if ( next02 === $pager.length ) { 923 next02 = 0; 924 } else if ( next02 === $pager.length + 1 ) { 925 next02 = 1; 926 } 927 928 $pager.eq( next01 ).addClass( 'showing' ); 929 $pager.eq( next02 ).addClass( 'showing' ); 930 } ); 931 $( '.slick-dots li:lt(3)', $recommendeddApp ).addClass( 'showing' ); 932 } 933 }; 934 935 function handleMediaChangeHome( e ) { 936 if ( e.matches ) { 937 slickApp() 938 } else { 939 if ( $recommendeddAppItem.length > 3) { 940 slickApp() 941 } else if ( $recommendeddApp.hasClass( 'slick-initialized' ) ) { 942 $recommendeddApp.slick( 'unslick' ); 943 } 944 } 945 } 946 947 mediaQuery.addEventListener( 'change', handleMediaChangeHome ); 948 949 handleMediaChangeHome( mediaQuery ); 950 } 951 952 /* ########## POS飿º ########## */ 953 954 if ( $body.hasClass( 'pos-renkei' ) ) { 955 $( 'table.col2' ).each( function () { 956 const $elms = $( this ).find( 'tbody' ).find( 'th, td' ); 957 $elms.filter( ':gt(' + ( $elms.length - 5 ) + ')' ).addClass( 'last' ); 958 } ); 959 } 960 961 const lazyloadObserverOptions = {
962 rootMargin: '-10% 0px -10% 0px', 963 } 964 const lazyloadObserver = new IntersectionObserver( function ( entry ) { 965 for ( let i = 0; i < entry.length; ++i ) { 966 if ( entry[i].isIntersecting ) { 967 entry[i].target.classList.add('lazyload'); 968 lazyloadObserver.unobserve(entry[i].target); 969 } 970 } 971 }, lazyloadObserverOptions ); 972 973 $( '.lazyBg ').each( function () { 974 lazyloadObserver.observe( this ); 975 } ); 976 977 978 /* ########## ããã¿ã¼ ########## */ 979 const currentYear = new Date().getFullYear(); 980 const copyrightClass = document.querySelector('#current-year'); 981 982 if (copyrightClass) { 983 copyrightClass.textContent = ` ${currentYear} `; 984 } 985 986 /* ########## ãããã¼ ########## */ 987 document.getElementById("headerbtn-campaign").addEventListener("click", function (event) { 988 event.preventDefault(); 989 990 const targetHash = "nelink=g-navi#campaign-list"; 991 const targetPage = "/about-nextengine/"; 992 const target = document.querySelector("#campaign-list"); 993 994 // ãã³ãã¼ã¬ã¼ã¡ãã¥ã¼å¯¾ç 995 const gnavDetail = document.getElementById("gnav-detail"); 996 const btMenu = document.getElementById("btMenu"); 997 998 // ã¢ãã¦ããã¼ã¸ã«ããå ´åã®ã¿ã¡ãã¥ã¼ãéãã¦ããé·ç§» 999 if (gnavDetail && gnavDetail.classList.contains("is-active") && window.location.pathname === targetPage) { 1000 btMenu.click(); 1001 } 1002 1003 // ã¢ãã¦ããã¼ã¸ã«ããå ´åã¯ã¹ã¯ãã¼ã« 1004 if (window.location.pathname === targetPage) { 1005 if (target) { 1006 let targetPosition = target.getBoundingClientRect().top + window.scrollY; 1007 targetPosition -= 50; 1008 1009 window.scrollTo({ 1010 top: targetPosition, 1011 behavior: "smooth" 1012 }); 1013 history.pushState(null, null, `?${targetHash}`); 1014 } 1015 } else { 1016 // ä»ã®ãã¼ã¸ã«ããå ´åã¯é·ç§» 1017 const newUrl = `${window.location.origin}${targetPage}?${targetHash}`; 1018 window.location.href = newUrl; 1019 } 1020 }); 1021 1022 // ãã¼ã¸ãã¼ãæã®ã¢ã³ã«ã¼ã¹ã¯ãã¼ã« 1023 window.addEventListener("load", function () { 1024 if (window.location.search.includes("nelink=g-navi") && window.location.hash === "#campaign-list") { 1025 const target = document.querySelector("#campaign-list"); 1026 if (target) { 1027 setTimeout(() => { 1028 let targetPosition = target.getBoundingClientRect().top + window.scrollY; 1029 targetPosition -= 50; 1030 1031 window.scrollTo({ 1032 top: targetPosition, 1033 behavior: "smooth" 1034 }); 1035 }, 200); 1036 } 1037 } 1038 }); 1039 1040 1041 1042});
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.