PageSourceSearch

https://www.okamura.co.jp/global_assets/js/cta.js?ver=20260731-084336

js okamura.co.jp collected 2026-10-01 10:30:26 UTC 2,340 bytes, 76 lines download raw bytes

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.