HEX
Server: Apache/2.4.65 (Ubuntu)
System: Linux ielts-store-v2 6.8.0-1036-gcp #38~22.04.1-Ubuntu SMP Thu Aug 14 01:19:18 UTC 2025 x86_64
User: root (0)
PHP: 7.2.34-54+ubuntu20.04.1+deb.sury.org+1
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: /var/www/html/ielts-store/wp-content/themes/oceanwp/assets/js/core/verticalHeader.js
var $j = jQuery.noConflict();

// On ready
$j( document ).ready( function() {
	"use strict";
	// Vertical header style
	oceanwpVerticalHeader();

} );

/* ==============================================
VERTICAL HEADER STYLE
============================================== */
function oceanwpVerticalHeader() {
	"use strict"

	// Return if no vertical header style
	if ( ! $j( '#site-header' ).hasClass( 'vertical-header' ) ) {
		return;
	}

	// Vars
	var $siteHeader = $j( '#site-header.vertical-header #site-header-inner' ),
		$hasChildren = $j( '#site-header.vertical-header li.menu-item-has-children' );

	// Add dropdown toggle (plus)
	$hasChildren.children( 'a' ).append( '<span class="dropdown-toggle"></span>' );

	// Toggle dropdowns
	var $dropdownTarget = $j( '.dropdown-toggle' );

	// Check localization
	if ( oceanwpLocalize.verticalHeaderTarget == 'link' ) {
		$dropdownTarget = $j( '#site-header.vertical-header li.menu-item-has-children > a' );
	}

	// Add toggle click event
	$dropdownTarget.on( 'tap click', function() {

		// Define toggle vars
		if ( oceanwpLocalize.verticalHeaderTarget == 'link' ) {
			var $toggleParentLi = $j( this ).parent( 'li' );
		} else {
			var $toggleParentLink = $j( this ).parent( 'a' ),
				$toggleParentLi   = $toggleParentLink.parent( 'li' );
		}

		// Get parent items and dropdown
		var $allParentLis = $toggleParentLi.parents( 'li' ),
			$dropdown     = $toggleParentLi.children( 'ul' );

		// Toogle items
		if ( ! $toggleParentLi.hasClass( 'active' ) ) {
			$hasChildren.not( $allParentLis ).removeClass( 'active' ).children( 'ul' ).slideUp( 'fast' );
			$toggleParentLi.addClass( 'active' ).children( 'ul' ).slideDown( 'fast', function() {
				$siteHeader.getNiceScroll().resize();
			} );
		} else {
			$toggleParentLi.removeClass( 'active' ).children( 'ul' ).slideUp( 'fast', function() {
				$siteHeader.getNiceScroll().resize();
			} );
		}

		// Return false
		return false;

	} );

	// Scrollbar
	if ( $siteHeader.length
		&& ! navigator.userAgent.match( /(Android|iPod|iPhone|iPad|IEMobile|Opera Mini)/ ) ) {
		$siteHeader.niceScroll( {
			autohidemode		: false,
			cursorborder		: 0,
			cursorborderradius	: 0,
			cursorcolor			: 'transparent',
			cursorwidth			: 0,
			horizrailenabled	: false,
			mousescrollstep		: 40,
			scrollspeed			: 60,
			zindex				: 100005,
		} );
	}

	// Open/Close header
	$j( 'a.vertical-toggle' ).on( 'click', function( e ) {
		e.preventDefault();

		if ( ! $j( 'body' ).hasClass( 'vh-opened' ) ) {

			$j( 'body' ).addClass( 'vh-opened' );
			$j( this ).find( '.hamburger' ).addClass( 'is-active' );

		} else {

			$j( 'body' ).removeClass( 'vh-opened' );
			$j( this ).find( '.hamburger' ).removeClass( 'is-active' );

		}

	} );

}