PageSourceSearch

https://www.hiltes.com/wp-content/themes/ark/assets/scripts/components/header-sticky.js?ver=6.9.7

js hiltes.com collected 2026-09-24 13:16:43 UTC 2,059 bytes, 71 lines download raw bytes

1(function($){
2// Header Sticky
3var HeaderSticky = function() {
4	'use strict';
5
6	// Handle Header Sticky
7	var handleHeaderSticky = function() {
8		if($('.header-sticky').length){
9			// On loading, check to see if more than 15px, then add the class
10			if ($('.header-sticky').offset().top > 15) {
11				$('.header-sticky').addClass('header-shrink');
12			}
13
14			// On scrolling, check to see if more than 15px, then add the class
15			$(window).on('scroll', function() {
16				if ($('.header-sticky').offset().top > 15) {
17					$('.header-sticky').addClass('header-shrink');
18				} else {
19					$('.header-sticky').removeClass('header-shrink');
20				}
21			});
22		}
23		if($('.ark-topbar').length){
24			var ark_topbar_reinit = function(){
25				$('.ark-topbar').each(function(){
26					var $this = $(this);
27					var hasVisibleWrapper = $this.parent('.ark-topbar-wrapper').is(':visible');
28					if( ! hasVisibleWrapper ) {
29						$this.parent('.ark-topbar-wrapper').css('height','1px').css('opacity','0').css('display','block');
30					}
31
32					var height = $this.height();
33					if ($('body').hasClass('admin-bar')) {
34						if( 783 <= $(window).width() ) {
35							height = height + $('#wpadminbar').height();
36						}
37					}
38					$this.parent('.ark-topbar-wrapper').css('height', height + 'px');
39					$('.wrapper-topbar-top-space').css('height', height + 'px');
40					$('.wrapper-topbar-top-space-xs').css('height', height + 'px');
41					$this.parent('.ark-topbar-wrapper').addClass('ark-topbar-initialized');
42
43					if( ! hasVisibleWrapper ) {
44						$this.parent('.ark-topbar-wrapper').css('display','none').css('opacity','1');
45					}
46
47				});
48			};
49			$(document).ready(function(){
50				ark_topbar_reinit();
51			});
52			$(window).load(function(){
53				ark_topbar_reinit();
54			});
55			$(window).resize(function(){
56				ark_topbar_reinit();
57			});
58		}
59	};
60
61	return {
62		init: function() {
63			handleHeaderSticky(); // initial setup for header sticky
64		}
65	}
66}();
67
68$(document).ready(function() {
69	HeaderSticky.init();
70});
71})(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.