PageSourceSearch

https://www.gearbooker.com/blog/wp-content/themes/colormag.1.4.9/colormag/js/colormag-custom.js?ver=7.1.2

js gearbooker.com collected 2026-09-24 11:56:34 UTC 4,853 bytes, 177 lines download raw bytes

1jQuery( document ).ready( function () {
2
3	/**
4	 * Search
5	 */
6	var hideSearchForm = function() {
7		jQuery( '#masthead .search-form-top' ).removeClass( 'show' );
8	};
9
10	// For Search Icon Toggle effect added at the top.
11	jQuery( '.search-top' ).click(
12		function () {
13			jQuery( this ).next( '#masthead .search-form-top' ).toggleClass( 'show' );
14
15			// Focus after some time to fix conflict with toggleClass.
16			setTimeout(
17				function () {
18					jQuery( '#masthead .search-form-top input' ).focus();
19				},
20				200
21			);
22
23			// For esc key press.
24			jQuery( document ).on(
25				'keyup',
26				function ( e ) {
27					// On esc key press.
28					if ( 27 === e.keyCode ) {
29						// If search box is opened.
30						if ( jQuery( '#masthead .search-form-top' ).hasClass( 'show' ) ) {
31							hideSearchForm();
32						}
33					}
34				}
35			);
36
37			jQuery( document ).on(
38				'click.outEvent',
39				function ( e ) {
40					if ( e.target.closest( '.top-search-wrap' ) ) {
41						return;
42					}
43
44					hideSearchForm();
45
46					// Unbind current click event.
47					jQuery( document ).off( 'click.outEvent' );
48				}
49			);
50		}
51	);
52
53	jQuery( '#scroll-up' ).hide();
54
55	jQuery( function () {
56		jQuery( window ).scroll( function () {
57			if ( jQuery( this ).scrollTop() > 1000 ) {
58				jQuery( '#scroll-up' ).fadeIn();
59			} else {
60				jQuery( '#scroll-up' ).fadeOut();
61			}
62		} );
63
64		jQuery( 'a#scroll-up' ).click( function () {
65			jQuery( 'body,html' ).animate( {
66				scrollTop : 0
67			}, 800 );
68			return false;
69		} );
70	} );
71
72	jQuery( '.better-responsive-menu #site-navigation .menu-item-has-children' ).append( '<span class="sub-toggle"> <i class="fa fa-caret-down"></i> </span>' );
73
74	jQuery( '.better-responsive-menu #site-navigation .sub-toggle' ).click( function () {
75		jQuery( this ).parent( '.menu-item-has-children' ).children( 'ul.sub-menu' ).first().slideToggle( '1000' );
76		jQuery( this ).children( '.fa-caret-right' ).first().toggleClass( 'fa-caret-down' );
77		jQuery( this ).toggleClass( 'active' );
78	} );
79
80	jQuery( document ).on( 'click', '#site-navigation ul li.menu-item-has-children > a', function ( event ) {
81		var menuClass = jQuery( this ).parent( '.menu-item-has-children' );
82
83		if ( ! menuClass.hasClass( 'focus' ) && jQuery( window ).width() <= 768 ) {
84			menuClass.addClass( 'focus' );
85			event.preventDefault();
86			menuClass.children( '.sub-menu' ).css( {
87				'display' : 'block'
88			} );
89		}
90	} );
91
92	/**
93	 * Scrollbar on fixed responsive menu
94	 */
95	jQuery( window ).load( function () {
96		if ( window.matchMedia( "(max-width: 768px)" ).matches && jQuery( '#masthead .sticky-wrapper' ).length >= 1 ) {
97
98			var screenHeight        = jQuery( window ).height();
99			var availableMenuHeight = screenHeight - 43;
100			var menu                = jQuery( '#site-navigation' ).find( 'ul' ).first();
101
102			menu.css( 'max-height', availableMenuHeight )
103			menu.addClass( 'menu-scrollbar' );
104
105		}
106	} );
107
108	// Featured Image Popup Setting.
109	if ( typeof jQuery.fn.magnificPopup !== 'undefined' ) {
110		jQuery( '.image-popup' ).magnificPopup( { type : 'image' } );
111	}
112
113	// Fitvids setting.
114	if ( typeof jQuery.fn.fitVids !== 'undefined' ) {
115		jQuery( '.fitvids-video' ).fitVids();
116	}
117
118	// Settings of the ticker.
119	if ( typeof jQuery.fn.newsTicker !== 'undefined' ) {
120		jQuery( '.newsticker' ).newsTicker( {
121			row_height   : 20,
122			max_rows     : 1,
123			speed        : 1000,
124			direction    : 'down',
125			duration     : 4000,
126			autostart    : 1,
127			pauseOnHover : 1
128		} );
129	}
130
131	// Settings of the sticky menu.
132	if ( typeof jQuery.fn.sticky !== 'undefined' ) {
133		var wpAdminBar = jQuery( '#wpadminbar' );
134		if ( wpAdminBar.length ) {
135			jQuery( '#site-navigation' ).sticky( {
136				topSpacing : wpAdminBar.height(),
137				zIndex     : 999
138			} );
139		} else {
140			jQuery( '#site-navigation' ).sticky( {
141				topSpacing : 0,
142				zIndex     : 999
143			} );
144		}
145	}
146
147	// BxSlider JS Settings.
148	if ( typeof jQuery.fn.bxSlider !== 'undefined' ) {
149		jQuery( '.widget_slider_area_rotate' ).bxSlider( {
150			mode           : 'horizontal',
151			speed          : 1500,
152			auto           : true,
153			pause          : 5000,
154			adaptiveHeight : true,
155			nextText       : '',
156			prevText       : '',
157			nextSelector   : '.slide-next',
158			prevSelector   : '.slide-prev',
159			pager          : false,
160			tickerHover    : true
161		} );
162
163		jQuery( '.blog .gallery-images, .archive .gallery-images, .search .gallery-images, .single-post .gallery-images' ).bxSlider( {
164			mode           : 'fade',
165			speed          : 1500,
166			auto           : true,
167			pause          : 3000,
168			adaptiveHeight : true,
169			nextText       : '',
170			prevText       : '',
171			nextSelector   : '.slide-next',
172			prevSelector   : '.slide-prev',
173			pager          : false
174		} );
175	}
176
177} );

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.