PageSourceSearch

https://valleytourism.ca/wp-content/themes/parallelus-go-explore/assets/js/theme-scripts.js?ver=1.0

js valleytourism.ca collected 2026-10-02 13:49:17 UTC 10,591 bytes, 311 lines download raw bytes

1jQuery(document).ready(function($){
2
3	// Top navbar animation
4	// ------------------------------------------------------------------------
5	$(document).bind('shrink-menu-init', function(e, status) {
6		var topBarHeight = $('.navbar-extra-top').outerHeight(); // getting the height of the nabar-extra-top
7		scrollMark = Math.max(topBarHeight, 30); // forced minimum of 30
8		style = ".menu-shrink {top : -"+topBarHeight+"px !important;}";
9		if ( !$('#ShrinkMenu').length ) {
10			$( "<style></style>" ).attr('id','ShrinkMenu').data('scrollMark',scrollMark).appendTo( "head" ); // add custom CSS for height offset
11		}
12		$('#ShrinkMenu').html(style);
13	});
14	// navbar adjustments on scroll
15	$(document).bind('shrink-menu', function(e, status){
16		scrollMark = $('#ShrinkMenu').data('scrollMark');
17		// when scroll hits height of navbar top, apply style changes
18		if ( $(this).scrollTop() < scrollMark ) {
19			$('#MainMenu').removeClass('scrolled menu-shrink');
20		} else {
21			$('#MainMenu').addClass('scrolled menu-shrink');
22		}
23	});
24	// trigger shrink-menu on scroll
25	$(window).resize( function(){
26		$(document).trigger('shrink-menu-init');
27	});
28	$(window).scroll( function(){
29		$(document).trigger('shrink-menu');
30	});
31
32
33	// Sub-navbar affix on scroll
34	// ------------------------------------------------------------------------
35	if ($('#SubMenu').length) {
36		$('#SubMenu').affix({
37			offset: {
38				top: function () {
39					return $('#SubMenu').parent().offset().top - $('#navbar-main-container').outerHeight();
40				},
41			}
42		}).css('top',$('#navbar-main-container').outerHeight());
43		// Update values on window resize
44		$(window).resize( function() {
45			theTop = $('#SubMenu').parent().offset().top - $('#navbar-main-container').outerHeight();
46			$('#SubMenu').data('bs.affix').options.offset = { top: theTop };
47		});
48
49		$('#SubMenu').on('affixed.bs.affix', function() {
50			$('a.navbar-brand.scrollTop span').text($('#destination-the-title').val());
51		});
52		$('#SubMenu').on('affixed-top.bs.affix', function() {
53			setTimeout( function() { $('a.navbar-brand.scrollTop span').text(''); } , 600)
54		});		
55	}
56
57
58	// Accordions - always have 1 panel open
59	// ------------------------------------------------------------------------
60	if ( $('.panel-heading').length ) {
61
62		$('.panel-heading').on('click',function(e){
63			if($(this).parents('.panel').children('.panel-collapse').hasClass('in')){
64				e.preventDefault();
65				e.stopPropagation();
66			}
67		});
68	}
69
70
71	// Tooltips
72	// ------------------------------------------------------------------------
73	$('[data-toggle="tooltip"]').tooltip({
74		placement: function(tip, trigger) {
75			// show above, unless no space. show bottom on affixed sub-nav
76			return ( $(trigger).parents('#SubMenu.affix').length ) ? 'bottom' : 'auto top';
77		}
78	});
79
80
81	// Popovers
82	// ------------------------------------------------------------------------
83	$('[data-toggle="popover"]').popover();
84
85	// Next/Prev Post Nav
86	$('.nav-previous > a, .nav-next > a').popover({
87		html : true,
88		placement : 'top',
89		trigger : 'hover',
90		delay : { "show": 500, "hide": 100 },
91		title : function() {
92			return $(this).find('.meta-nav-title').html();
93		},
94		content : function() {
95			var img = $('<img class="placeholder" width="600" height="800" style="visibility:hidden" >');
96			img.attr('src', 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAICAMAAADtGH4KAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDE0IDc5LjE1Njc5NywgMjAxNC8wOC8yMC0wOTo1MzowMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjMxQjk3NTA3RjJGRDExRTRCNjk0Rjg0QjlEODkzNDkxIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjMxQjk3NTA4RjJGRDExRTRCNjk0Rjg0QjlEODkzNDkxIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6MzFCOTc1MDVGMkZEMTFFNEI2OTRGODRCOUQ4OTM0OTEiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6MzFCOTc1MDZGMkZEMTFFNEI2OTRGODRCOUQ4OTM0OTEiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz6NsDE8AAAABlBMVEXp6usAAAD3NurCAAAADklEQVR42mJgIA8ABBgAADgAAYdNUgcAAAAASUVORK5CYII=');
97			return img;
98		},
99		template : '<div class="popover post-nav-popover" role="tooltip"><div class="arrow"></div><div class="popover-content"></div><h3 class="popover-title"></h3></div>'
100	});
101	// add image to background
102	$('.nav-previous > a, .nav-next > a').on('shown.bs.popover', function (e) {
103		id = $(this).attr('aria-describedby');
104		$('#'+id).css({
105			'background-image' : 'url('+ $(this).find('.meta-nav-img').text() +')'
106		});
107	})
108
109
110	// Owl carousel
111	// ------------------------------------------------------------------------
112	if ( $('.featured-carousel').length ) {
113		$(".featured-carousel").owlCarousel({
114			items: 1,
115			loop: true,
116			autoplay: true,
117			autoplayHoverPause: true,
118			autoplayTimeout: 3800,
119			autoplaySpeed: 800,
120			navSpeed: 500,
121			dots: false,
122			nav: true,
123			navText: [
124				'<i class="fa fa-angle-left"></i>',
125				'<i class="fa fa-angle-right"></i>'
126			]
127		});
128	}
129
130
131	// Navbar Hover/Click Responsive Behavior
132	// ------------------------------------------------------------------------
133	collapseSize = 1299; // 768;
134
135	// hover sub-menu items
136	$('.navbar-nav a').click( function(e) {
137		$this = $(e.target);
138		href = $this.attr('href'); // Link URL
139
140		// Check link value
141		if (href === undefined || !href.length || href === '#' || href === 'javascript:;') {
142			href = false;
143		}
144		// Link behavior
145		if ($this.hasClass('dropdown-toggle')) {
146			// Parent menu items
147			if ($(window).width() > collapseSize) {
148				if (href) {
149					// large screens, follow the parent menu link when clicked
150					if (e.which !== 2 && e.target.target != '_blank') {
151						window.location.href = href;
152					}
153				}
154			 } else if ( $this.parent().hasClass('open') && href !== false) {
155				// small screens, 1st tap opens sub-menu & 2nd tap follows link
156				$(document).trigger('collapse-menus');
157				window.location.href = href;
158			}
159		} else {
160			// All other menu items, close menu on click
161			$(document).trigger('collapse-menus');
162		}
163	});
164	// Keep parent menus open on sub-menu expand
165	$(document).on('show.bs.dropdown', function(obj) {
166		if ($(window).width() <= collapseSize) {
167			$(obj.target).parents('.show-on-hover').addClass('open');
168		}
169	});
170	$('.navbar a:not(.dropdown-toggle)').click( function(e) {
171
172		$this = $(e.target);
173		href = $this.attr('href'); // Link URL
174
175		// Check link value
176		if (href === undefined || !href.length || href === '#' || href === 'javascript:;') {
177			href = false;
178		}
179		// Link behavior
180		if ($(window).width() > collapseSize) {
181			if (href) {
182				// large screens, follow the parent menu link when clicked
183				if (e.which !== 2 && e.target.target != '_blank') {
184					window.location.href = href;
185				}
186			}
187		 } else if ( $this.parent().hasClass('open') && href !== false) {
188			// small screens, 1st tap opens sub-menu & 2nd tap follows link
189			$(document).trigger('collapse-menus');
190			window.location.href = href;
191		}
192	});
193	// Close all menus
194	$(document).on('collapse-menus', function () {
195		$('.collapse.in').removeClass('in').children().removeClass('open');
196	});
197	// Hover styling helpers
198	$('.navbar-nav > li.show-on-hover').hover(function() {
199		if ($(window).width() > collapseSize) {
200			$(this).addClass('open');
201		}
202	}, function() {
203		if ($(window).width() > collapseSize) {
204			$(this).removeClass('open');
205		}
206	});
207
208
209	// Setup local scrolling and pre-defined anchor tags
210	// ------------------------------------------------------------------------
211	$scrollTop = $("a.scrollTop, .scrollTop a, a[href='#top']");
212
213	// Back to the top of the page (behavior)
214	$scrollTop.on("click", function( event ) {
215		event.preventDefault();
216		$('html,body').stop().animate({ scrollTop: 0 }, 1000); // scroll
217	});
218
219
220	// Responsive video embeds
221	// ------------------------------------------------------------------------
222	$(".entry-content, .video-container").fitVids();
223
224
225	// Maps - toggle show/hide button
226	// ------------------------------------------------------------------------
227	mapTransition = {
228		'height':'100%',
229		'transition':'height .45s ease-out',
230		'-webkit-transition':'height .45s ease-out',
231		'-moz-transition':'height .45s ease-out'
232	};
233	jQuery('#HeaderMapToggle').click( function(e) {
234		e.preventDefault();
235		$(this).blur(); // prevents lingering focus styles
236
237		$hero = jQuery('section.hero');
238		$map = jQuery('#gmap_wrapper');
239		mapZindex = $map.css('z-index');
240
241
242		// on hidden start, z-index used to ensure map is rendered but not visible
243		if (parseInt(mapZindex) < 0) {
244			$map.css({
245				'z-index' : 0,
246				'height'  : '0px'
247			});
248		} else {
249			$map.css(mapTransition); // makes sure transitions work on visible start
250		}
251
252		mapHeight = $map.css('height');
253
254		// Show/hide
255		if ($hero.hasClass('mapOn')) {
256			$map.css({
257				'height':'0px',
258			});
259
260			$hero.addClass('mapOff').removeClass('mapOn');
261			$(this).parent('li').removeClass('open');
262		} else {
263			$map.css(mapTransition); //
264
265			$hero.addClass('mapOn').removeClass('mapOff');
266			$(this).parent('li').addClass('open');
267
268			setTimeout(function(){
269				jQuery('html, body').animate({
270					scrollTop: 0
271				}, 500);
272			}, 100);
273		}
274
275	});
276
277
278	// Maps - fade overlays on map hover
279	// ------------------------------------------------------------------------
280	$heroOverlays = $( this ).find('.bg-overlay').add($('#MainMenu'));
281	$('.hero').hover(
282		function() {
283			if ( $(this).hasClass('mapOn') ) {
284				// Hide overlays
285				$heroOverlays.stop(true).animate({
286					opacity: 0
287				}, 120, function() {
288					$( this ).css('z-index', '-1');
289				});
290			}
291		}, function() {
292			if ( $(this).hasClass('mapOn') ) {
293				// Show overlays
294				$heroOverlays.stop(true).css('z-index', '1').animate({
295					opacity: 1
296				}, 400, function() {
297					$('#MainMenu').css('z-index', '1030'); // needs to be above bg-overlay
298				});
299			}
300		}
301	);
302
303
304	// Things we want to trigger once, manually, after loading the page
305	// ------------------------------------------------------------------------
306
307	// Fire the menu shrink function
308	$(document).trigger('shrink-menu-init');
309	$(document).trigger('shrink-menu');
310
311});

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.