1let timeoutId = null; 2let resizeTimeout; 3 4function initCtaScript() { 5 if ($('.okm--cta--block').length && window.innerWidth >= 1024) { 6 7 // 1. åæç¶æ ã§ .okm--global--cta--wrap ãé表示 8 $('.okm--global--cta--wrap').hide(); 9 10 // 2. ãã©ã¦ã¶ã®ã¦ã£ã³ãã¦ãµã¤ãºãåå¾ 11 const windowHeight = window.innerHeight; 12 13 // 3. ã¹ã¯ãã¼ã«æã®å¦ç 14 $(window).on('scroll.cta', function() { 15 if ($(window).scrollTop() >= 2 + windowHeight) { 16 $('.okm--global--cta--wrap').fadeIn(); 17 } else { 18 $('.okm--global--cta--wrap').fadeOut(); 19 } 20 }); 21 22 // ãã¦ã¹ãªã¼ãã¼æã®å¦ç 23 $('.okm--global--cta--wrap > .okm--global--cta > .okm--global--cta--item').on('mouseenter.cta', function() { 24 $(this).addClass('open').siblings().addClass('open'); 25 $('.cta--screen').fadeIn(); 26 if (timeoutId) { 27 clearTimeout(timeoutId); 28 timeoutId = null; 29 } 30 }); 31 32 // ãã¦ã¹ã¢ã¦ãæã®å¦ç 33 $('.okm--global--cta--wrap > .okm--global--cta > .okm--global--cta--item').on('mouseleave.cta', function() { 34 timeoutId = setTimeout(() => { 35 $(this).removeClass('open').siblings().removeClass('open'); 36 $('.cta--screen').fadeOut(); 37 }, 700); 38 }); 39 40 // é«ãã»ä½ç½®è¨å® 41 setCtaBlockHeight(); 42 } 43} 44 45function setCtaBlockHeight() { 46 const headerHeight = $('.okm--h--wrapper--header').outerHeight(true) || 0; 47 const inquiryHeight = $('.okm--wrap--inquiry').outerHeight(true) || 0; 48 const footerHeight = $('.okm--wrapper--footer').outerHeight(true) || 0; 49 const doubleFooterHeight = $('.okm--wrapper--footer').next('.okm--wrapper--footer').outerHeight(true) || 0; 50 51 const totalSubtractHeight = headerHeight + inquiryHeight + footerHeight + doubleFooterHeight; 52 53 const wrapperHeight = $('body').innerHeight(); 54 const finalHeight = wrapperHeight - totalSubtractHeight; 55 $('.okm--cta--block').height(finalHeight > 0 ? finalHeight : 0); 56 $('.okm--cta--block').css('top', headerHeight); 57} 58 59$(document).ready(function() { 60 initCtaScript(); 61}); 62 63$(window).on('load', function () { 64 if ($('.okm--cta--block').length && window.innerWidth >= 1024) { 65 setCtaBlockHeight(); 66 } 67}); 68 69$(window).on('resize', function () { 70 if ($('.okm--cta--block').length && window.innerWidth >= 1024) { 71 clearTimeout(resizeTimeout); 72 resizeTimeout = setTimeout(function () { 73 setCtaBlockHeight(); 74 }, 200); 75 } 76});
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.