HEX
Server: Apache
System: Linux server-674799.igrow.ws 5.14.0-611.30.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Feb 11 06:42:00 EST 2026 x86_64
User: elrashedytravel (1025)
PHP: 8.1.34
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/elrashedytravel/public_html/wp-content/themes/poseidon/assets/js/sticky-header.js
/**
 * Sticky Header
 *
 * Copyright 2017 ThemeZee
 * Free to use under the GPLv2 and later license.
 * http://www.gnu.org/licenses/gpl-2.0.html
 *
 * Author: Thomas Weichselbaumer (themezee.com)
 *
 * @package Poseidon
 */

(function($) {

	/**--------------------------------------------------------------
	# Sticky Header
	--------------------------------------------------------------*/
	$.fn.stickyHeader = function() {

		var body = $( 'body' ),
			top_position = $( this ).offset().top - body.offset().top - 1,
			header_height = $( this ).height() + top_position,
			small_header = top_position + 70;

		var makeSticky = function() {

			var window_top = $( window ).scrollTop();

			if ( window_top > top_position ) {

				body.addClass( 'sticky-header' );
				body.css( 'padding-top', header_height + 'px' );

			} else {

				body.removeClass( 'sticky-header' );
				body.css( 'padding-top', '0' );

			}

			if ( window_top > small_header ) {
				body.addClass( 'small-header' );
			} else {
				body.removeClass( 'small-header' );
			}
		}

		makeSticky();

		$( window ).scroll( makeSticky );

	};

	/**--------------------------------------------------------------
	# Setup Sticky Header
	--------------------------------------------------------------*/
	$( document ).ready( function() {

		/* Add Sticky Header feature */
		$( '.site-header' ).stickyHeader();

	} );

}(jQuery));