PageSourceSearch

https://www.standardeventrentals.com/wp-content/themes/standardpartyrentals/js/navigation.js?ver=7.1.2

js standardeventrentals.com collected 2026-10-10 02:25:19 UTC 3,644 bytes, 139 lines download raw bytes

1/**
2 * File navigation.js.
3 *
4 * Handles toggling the navigation menu for small screens and enables TAB key
5 * navigation support for dropdown menus.
6 */
7 /*
8( function() {
9	var container, button, menu, links, i, len;
10
11	container = document.getElementById( 'site-navigation' );
12	if ( ! container ) {
13		return;
14	}
15
16	button = document.getElementById( 'primary-menu-triger' );
17	if ( 'undefined' === typeof button ) {
18		return;
19	}
20
21	menu = container.getElementsByTagName( 'ul' )[0];
22
23	// Hide menu toggle button if menu is empty and return early.
24	if ( 'undefined' === typeof menu ) {
25		button.style.display = 'none';
26		return;
27	}
28
29	menu.setAttribute( 'aria-expanded', 'false' );
30	if ( -1 === menu.className.indexOf( 'nav-menu' ) ) {
31		menu.className += ' nav-menu';
32	}
33
34	button.onclick = function() {
35		if ( -1 !== container.className.indexOf( 'toggled' ) ) {
36			container.className = container.className.replace( ' toggled', '' );
37			button.setAttribute( 'aria-expanded', 'false' );
38			menu.setAttribute( 'aria-expanded', 'false' );
39		} else {
40			container.className += ' toggled';
41			button.setAttribute( 'aria-expanded', 'true' );
42			menu.setAttribute( 'aria-expanded', 'true' );
43		}
44	};
45
46	// Get all the link elements within the menu.
47	links    = menu.getElementsByTagName( 'a' );
48
49	// Each time a menu link is focused or blurred, toggle focus.
50	for ( i = 0, len = links.length; i < len; i++ ) {
51		links[i].addEventListener( 'focus', toggleFocus, true );
52		links[i].addEventListener( 'blur', toggleFocus, true );
53	}
54
55	function toggleFocus() {
56		var self = this;
57
58		// Move up through the ancestors of the current link until we hit .nav-menu.
59		while ( -1 === self.className.indexOf( 'nav-menu' ) ) {
60
61			// On li elements toggle the class .focus.
62			if ( 'li' === self.tagName.toLowerCase() ) {
63				if ( -1 !== self.className.indexOf( 'focus' ) ) {
64					self.className = self.className.replace( ' focus', '' );
65				} else {
66					self.className += ' focus';
67				}
68			}
69
70			self = self.parentElement;
71		}
72	}
73
74	// Toggles `focus` class to allow submenu access on tablets.
75
76	( function( container ) {
77		var touchStartFn, i,
78			parentLink = container.querySelectorAll( '.menu-item-has-children > a, .page_item_has_children > a' );
79
80		if ( 'ontouchstart' in window ) {
81			touchStartFn = function( e ) {
82				var menuItem = this.parentNode, i;
83
84				if ( ! menuItem.classList.contains( 'focus' ) ) {
85					e.preventDefault();
86					for ( i = 0; i < menuItem.parentNode.children.length; ++i ) {
87						if ( menuItem === menuItem.parentNode.children[i] ) {
88							continue;
89						}
90						menuItem.parentNode.children[i].classList.remove( 'focus' );
91					}
92					menuItem.classList.add( 'focus' );
93				} else {
94					menuItem.classList.remove( 'focus' );
95				}
96			};
97
98			for ( i = 0; i < parentLink.length; ++i ) {
99				parentLink[i].addEventListener( 'touchstart', touchStartFn, false );
100			}
101		}
102	}( container ) );
103} )();
104*/
105(function ($, root, undefined) {
106	
107	$(document).ready(function() {
108	
109		'use strict';
110
111		function bodyPadding(){
112			$("body").css("padding-top", $('.site-header').height());
113		};
114		bodyPadding();
115		$(window).resize(function(e) {
116        	bodyPadding();
117    	});
118		var menu 	= $('#site-navigation');
119		$(window).resize(function(){
120			var w = $(window).width();
121			if(w > 991 && menu.is(':hidden')) {
122				menu.removeAttr('style');
123			}
124		});
125
126		$('#primary-menu-triger').click(function() {
127			$('body').toggleClass("overflow");
128			$('#site-navigation').slideToggle();
129		});
130
131		$('.toggle-secondary-menu').click(function() {
132			$('body').toggleClass("overflow");
133			$('.secondary-menu-block').fadeToggle();
134		});
135
136	});
137
138
139})(jQuery, this);

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.