PageSourceSearch

https://www.golfhotel-saint-samson.com/wp-content/plugins/coherence-core/assets/js/custom-header.js?ver=5.0.0

js golfhotel-saint-samson.com collected 2026-10-08 19:42:31 UTC 3,106 bytes, 115 lines download raw bytes

1(function($) {
2
3	$.headerBuilder = function() {
4		var $header = $('.site-header'),
5			$stickyElements = $('.header-sticky-row'),
6			$firstSticky = '',
7			$window = $(window),
8			isSticked = false,
9			stickAfter = 100,
10			cloneHTML = '',
11			previousScroll;
12
13		$stickyElements.each(function() {
14			var $this = $(this);
15
16			if ($this[0].offsetHeight > 10) {
17				$firstSticky = $this;
18				return false;
19			}
20		});
21
22		// Real header sticky option
23		if (!$header.hasClass('header-with-sticky-template')) {
24			var $adminBar = $('#wpadminbar');
25			var headerHeight = $header.find('.header-wrapper')[0].offsetHeight;
26			var adminBarHeight = $adminBar.length > 0 ? $adminBar[0].offsetHeight : 0;
27
28			if (!$header.hasClass('header-with-sticky-template')) {
29				if ($firstSticky.length === 0 || $firstSticky[0].offsetHeight < 10) {
30					return;
31				}
32
33				if(!$header.hasClass('header-transparent')) {
34					$header.addClass('header-sticky-prepared').css({
35						paddingTop: headerHeight
36					});
37				}
38
39				stickAfter = $firstSticky.offset().top - adminBarHeight;
40			}
41
42		}
43
44		if ($header.hasClass('header-with-sticky-template')) {
45			$header = $header.next('.header-sticky-template');
46			//$header.find('.whb-row').removeClass('whb-flex-equal-sides').addClass('whb-flex-flex-middle');
47		}
48
49		$window.on('scroll', function() {
50			var $header = $('.site-header'),
51			$stickyElements = $('.header-sticky-row'),
52			$firstSticky = '',
53			$window = $(window),
54			previousScroll;
55			var after = stickAfter;
56			var currentScroll = $window.scrollTop();
57			var windowHeight = $window.height();
58			var documentHeight = $(document).height();
59
60			if (currentScroll > after) {
61				$header.addClass('sticky-active');
62			if($header.hasClass('header-light')) {
63				$header.addClass('header-light-disabled');
64				$header.removeClass('header-light');
65			}
66			menuDropdownRecalc();
67			} else {
68				$header.removeClass('sticky-active');
69			if($header.hasClass('header-light-disabled')) {
70				$header.addClass('header-light');
71				$header.removeClass('header-light-disabled');
72			}
73			menuDropdownRecalc();
74			}
75
76			previousScroll = currentScroll;
77		});
78
79		function stickHeader() {
80			$header.addClass('sticky-active');
81			if($header.hasClass('header-light')) {
82				$header.addClass('header-light-disabled');
83				$header.removeClass('header-light');
84			}
85			menuDropdownRecalc();
86		}
87
88		function unstickHeader() {
89			if (!isSticked) {
90				return;
91			}
92
93			isSticked = false;
94			$header.removeClass('sticky-active');
95			if($header.hasClass('header-light-disabled')) {
96				$header.addClass('header-light');
97				$header.removeClass('header-light-disabled');
98			}
99			menuDropdownRecalc();
100		}
101
102		function menuDropdownRecalc() {
103			if (!$header.hasClass('header-boxed')) {
104				return;
105			}
106
107			$('.header-offsets-calculated .header-dropdown-menu').attr('style', '');
108			$('.header-offsets-calculated').removeClass('header-offsets-calculated');
109		}
110	};
111
112	$(document).on('ready', function() {
113		$.headerBuilder();
114	});
115})(jQuery);

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.