PageSourceSearch

https://www.eranet.gr/wp-content/themes/Melos_Pro/lib/scripts/main-frontend.js?ver=1.7.3

js eranet.gr collected 2026-10-02 07:24:36 UTC 32,062 bytes, 871 lines download raw bytes

1/**
2/**
3 * Wordpress Front End Enhancements.
4 *
5 * jQuery effects used in theme.
6 */
7
8// ----------------------------------------------------------------------------------
9//	FORMAT FOOTER LAYOUT
10// ----------------------------------------------------------------------------------
11
12jQuery(document).ready(function(){
13
14	jQuery('#footer-core .widget-area:last-child').addClass("last");
15
16	// Footer - Footer Widgets Layout (Options 1 - 6)
17	jQuery('#footer-core.option2 .widget-area').addClass("one_half");
18	jQuery('#footer-core.option3 .widget-area').addClass("one_third");
19	jQuery('#footer-core.option4 .widget-area').addClass("one_fourth");
20	jQuery('#footer-core.option5 .widget-area').addClass("one_fifth");
21	jQuery('#footer-core.option6 .widget-area').addClass("one_sixth");
22
23	// Footer - Footer Widgets Layout (Option 7)
24	jQuery('#footer-core.option7 #footer-col1.widget-area').addClass("one_third");
25	jQuery('#footer-core.option7 #footer-col2.widget-area').addClass("two_third");
26
27	// Footer - Footer Widgets Layout (Option 8)
28	jQuery('#footer-core.option8 #footer-col1.widget-area').addClass("two_third");
29	jQuery('#footer-core.option8 #footer-col2.widget-area').addClass("one_third");
30
31	// Footer - Footer Widgets Layout (Option 9)
32	jQuery('#footer-core.option9 #footer-col1.widget-area').addClass("one_fourth");
33	jQuery('#footer-core.option9 #footer-col2.widget-area').addClass("three_fourth");
34
35	// Footer - Footer Widgets Layout (Option 10)
36	jQuery('#footer-core.option10 #footer-col1.widget-area').addClass("three_fourth");
37	jQuery('#footer-core.option10 #footer-col2.widget-area').addClass("one_fourth");
38
39	// Footer - Footer Widgets Layout (Option 11)
40	jQuery('#footer-core.option11 #footer-col1.widget-area').addClass("one_fifth");
41	jQuery('#footer-core.option11 #footer-col2.widget-area').addClass("four_fifth");
42
43	// Footer - Footer Widgets Layout (Option 12)
44	jQuery('#footer-core.option12 #footer-col1.widget-area').addClass("four_fifth");
45	jQuery('#footer-core.option12 #footer-col2.widget-area').addClass("one_fifth");
46
47	// Footer - Footer Widgets Layout (Option 13)
48	jQuery('#footer-core.option13 #footer-col1.widget-area').addClass("one_sixth");
49	jQuery('#footer-core.option13 #footer-col2.widget-area').addClass("one_sixth");
50	jQuery('#footer-core.option13 #footer-col3.widget-area').addClass("one_sixth");
51	jQuery('#footer-core.option13 #footer-col4.widget-area').addClass("one_half");
52
53	// Footer - Footer Widgets Layout (Option 14)
54	jQuery('#footer-core.option14 #footer-col1.widget-area').addClass("one_half");
55	jQuery('#footer-core.option14 #footer-col2.widget-area').addClass("one_sixth");
56	jQuery('#footer-core.option14 #footer-col3.widget-area').addClass("one_sixth");
57	jQuery('#footer-core.option14 #footer-col4.widget-area').addClass("one_sixth");
58
59	// Footer - Footer Widgets Layout (Option 15)
60	jQuery('#footer-core.option15 #footer-col1.widget-area').addClass("one_sixth");
61	jQuery('#footer-core.option15 #footer-col2.widget-area').addClass("one_third");
62	jQuery('#footer-core.option15 #footer-col3.widget-area').addClass("one_half");
63
64	// Footer - Footer Widgets Layout (Option 16)
65	jQuery('#footer-core.option16 #footer-col1.widget-area').addClass("one_half");
66	jQuery('#footer-core.option16 #footer-col2.widget-area').addClass("one_third");
67	jQuery('#footer-core.option16 #footer-col3.widget-area').addClass("one_sixth");
68
69	// Footer - Footer Widgets Layout (Option 17)
70	jQuery('#footer-core.option17 #footer-col1.widget-area').addClass("one_fourth");
71	jQuery('#footer-core.option17 #footer-col2.widget-area').addClass("one_fourth");
72	jQuery('#footer-core.option17 #footer-col3.widget-area').addClass("one_sixth");
73	jQuery('#footer-core.option17 #footer-col4.widget-area').addClass("one_sixth");
74	jQuery('#footer-core.option17 #footer-col5.widget-area').addClass("one_sixth");
75
76	// Footer - Footer Widgets Layout (Option 18)
77	jQuery('#footer-core.option18 #footer-col1.widget-area').addClass("one_sixth");
78	jQuery('#footer-core.option18 #footer-col2.widget-area').addClass("one_sixth");
79	jQuery('#footer-core.option18 #footer-col3.widget-area').addClass("one_sixth");
80	jQuery('#footer-core.option18 #footer-col4.widget-area').addClass("one_fourth");
81	jQuery('#footer-core.option18 #footer-col5.widget-area').addClass("one_fourth");
82});
83
84
85// ----------------------------------------------------------------------------------
86//	FORMAT SUB-FOOTER LAYOUT
87// ----------------------------------------------------------------------------------
88
89jQuery(document).ready(function(){
90
91	jQuery('#sub-footer-widgets .widget-area:last-child').addClass("last");
92	jQuery('#sub-footer-widgets .widget-area:last-child').after( '<div class="clearboth"></div>' );
93
94	// Footer - Footer Widgets Layout (Option 2)
95	jQuery('#sub-footer-widgets.option2 .widget-area').addClass("one_half");
96
97	// Footer - Footer Widgets Layout (Option 3)
98	jQuery('#sub-footer-widgets.option3 #sub-footer-col1.widget-area').addClass("one_third");
99	jQuery('#sub-footer-widgets.option3 #sub-footer-col2.widget-area').addClass("two_third");
100
101	// Footer - Footer Widgets Layout (Option 4)
102	jQuery('#sub-footer-widgets.option4 #sub-footer-col1.widget-area').addClass("two_third");
103	jQuery('#sub-footer-widgets.option4 #sub-footer-col2.widget-area').addClass("one_third");
104
105	// Footer - Footer Widgets Layout (Option 5)
106	jQuery('#sub-footer-widgets.option5 #sub-footer-col1.widget-area').addClass("one_fourth");
107	jQuery('#sub-footer-widgets.option5 #sub-footer-col2.widget-area').addClass("three_fourth");
108
109	// Footer - Footer Widgets Layout (Option 6)
110	jQuery('#sub-footer-widgets.option6 #sub-footer-col1.widget-area').addClass("three_fourth");
111	jQuery('#sub-footer-widgets.option6 #sub-footer-col2.widget-area').addClass("one_fourth");
112
113	// Footer - Footer Widgets Layout (Option 7)
114	jQuery('#sub-footer-widgets.option7 #sub-footer-col1.widget-area').addClass("one_fifth");
115	jQuery('#sub-footer-widgets.option7 #sub-footer-col2.widget-area').addClass("four_fifth");
116
117	// Footer - Footer Widgets Layout (Option 8)
118	jQuery('#sub-footer-widgets.option8 #sub-footer-col1.widget-area').addClass("four_fifth");
119	jQuery('#sub-footer-widgets.option8 #sub-footer-col2.widget-area').addClass("one_fifth");
120});
121
122
123/* ----------------------------------------------------------------------------------
124	MASONRY - LOAD AFTER IMAGES HAVE LOADED
125---------------------------------------------------------------------------------- */
126
127jQuery(document).ready(function() {
128
129	// Call imagedLoaded for Masonry if imagedLoaded function is available
130	(function ( $ ) {
131		if ( $.isFunction($.fn.imagesLoaded) ) {
132
133			// Different target for masonry on portfolio pages than any other page
134			if ( $( '#container' ).hasClass( 'portfolio-wrapper' ) ) {
135				var $container = $('#container-inner');
136			} else if ( $( 'body' ).hasClass( 'woo-shop-grid' ) ) {
137				var $container = $('#main-core .products');
138			} else {
139				var $container = $('#container');
140			}
141
142			$container.imagesLoaded( function() {
143				if ( $.isFunction($.fn.masonry) ) {
144					$container.masonry();
145				}
146			});
147		}
148	}( jQuery ));
149});
150
151
152// ----------------------------------------------------------------------------------
153//	FORMAT MAIN HEADER MENU
154// ----------------------------------------------------------------------------------
155
156function mainmenu(){
157
158	// Add menu-hover class
159	jQuery("header .header-links ul.menu > li").hover(function(){
160		jQuery(this).find('ul.sub-menu:first').css({visibility: "visible",display: "none"}).parent().addClass('menu-hover');
161	},function(){
162		jQuery(this).find('ul.sub-menu:first').css({visibility: "hidden",display: "none"}).parent().removeClass('menu-hover');
163	});
164
165	// Add menu-parent class
166	jQuery("header .header-links ul.menu > li").each(function(){
167		jQuery(this).find('ul.sub-menu').css({visibility: "visible",display: "none"}).parent().addClass('menu-parent');
168	});
169
170	// Change z-index of #pre-header so dropdown menus & tooltips can be seen
171	jQuery("#pre-header").hover(function(){
172		jQuery( this ).css({ 'z-index' : '999991' });
173	},function(){
174		jQuery( this ).css({ 'z-index' : '999' });
175	});
176
177	// Add smooth dropdown effect
178	jQuery("header .header-links li").hover(function(){
179		parentWidth = jQuery(this).width();
180		// Offset mega menu
181	    if(jQuery(this).hasClass('header-thinkupmega')) {
182
183			jQuery(this).find('ul').addClass( 'header-thinkupmegachild' );
184
185			// Assign width to mega menu children
186			megaColumnCount = jQuery(this).children( "ul" ).children( "li" ).length;
187			megaColumnWidth = 100 / megaColumnCount;
188			jQuery(this).children( "ul" ).children( "li" ).outerWidth( megaColumnWidth + "%" );
189
190			// Assign height to mega menu children - DISABLED DUE TO ISSUE WHERE MENU IS SHORTER THAN IT SHOULD BE
191//			megaColumnHeight = jQuery(this).children( "ul" ).height();
192//			jQuery(this).children( "ul" ).children( "li" ).outerHeight( megaColumnHeight );
193		}
194		// Prevent sub menus of mega menu from opening / closing
195	    if( ! jQuery(this).parent().hasClass('header-thinkupmegachild')) {
196			jQuery(this).find('ul:first').css({visibility: "visible",display: "none","min-width": parentWidth}).slideToggle(400);
197		}
198	},function(){
199		jQuery(this).find('ul:first').css({visibility: "hidden"});
200	});
201
202	// Correct menu for below header when navigating down page.
203	if( jQuery( 'body' ).hasClass( 'header-below' ) ) {
204		jQuery('#header').waypoint(function(direction) {
205			if (direction === 'down') {
206				jQuery( 'body' ).addClass( 'header-below2' );
207				jQuery( 'body' ).removeClass( 'header-below1' );
208			}
209			else {
210				jQuery( 'body' ).removeClass( 'header-below2' );
211				jQuery( 'body' ).addClass( 'header-below1' );
212			}
213		}, {
214			offset: '50%'
215		});
216	}
217}
218jQuery(document).ready(function(){
219	mainmenu();
220});
221
222
223/* ----------------------------------------------------------------------------------
224	RESPONSIVE MENU - TOGGLE SUB MENUS
225---------------------------------------------------------------------------------- */
226
227jQuery(document).ready(function (){
228
229	jQuery( '#header-responsive .menu-item-has-children > a' ).after( '<span class="sub-menu-toggle"></span>' );
230
231	jQuery( '#header-responsive .menu-item-has-children .sub-menu-toggle' ).click(function(e){ 
232
233		var parentmenu = jQuery( this ).closest('.menu-item-has-children');
234
235		if( parentmenu.hasClass( 'sub-menu-show' ) ) {
236			jQuery( parentmenu ).removeClass('sub-menu-show');
237		} else {
238			jQuery( parentmenu ).addClass('sub-menu-show');
239		}
240
241	});
242});
243
244
245// ----------------------------------------------------------------------------------
246//	PRE HEADER MENU - ADD "active" CLASS TO "#pre-header-search" WHEN INPUT IS FOCUSED
247// ----------------------------------------------------------------------------------
248
249jQuery(document).ready(function(){
250
251	jQuery( '#pre-header-search .search' ).focusin(function() {
252		jQuery( '#pre-header-search' ).addClass( 'active' ); 
253	});
254	jQuery( '#pre-header-search .search' ).focusout(function() {
255		jQuery( '#pre-header-search' ).removeClass( 'active' ); 
256	});
257
258});
259
260
261// ----------------------------------------------------------------------------------
262//	STICKY HEADER - ONLY ON SCREENS SMALLER THAN 768px
263// ----------------------------------------------------------------------------------
264
265jQuery(window).load(function(){
266
267	// Trigger sticky header on devices wider than 768px
268	if ( jQuery(window).width() > 768 && jQuery( 'body' ).hasClass( 'header-sticky' ) ) {
269
270		// Resize on scroll
271		jQuery(window).scroll(function() {
272
273			// Assign header height and position variables
274			var siteheader_height    = jQuery( '#site-header' ).height();
275			var preheader_height     = jQuery( '#pre-header' ).height();
276			var header_height        = jQuery( '#header' ).height();
277			var header_sticky_offset = jQuery( '#header-sticky' ).offset();
278
279			// Activate sticky header 100px after header is cleared
280			if ( !jQuery( 'body' ).hasClass( 'header-below' ) ) {
281				if ( header_sticky_offset.top > preheader_height + header_height + 100 ) {
282					jQuery( 'body' ).addClass( 'header-sticky-active' );
283				} else {
284					jQuery( 'body' ).removeClass( 'header-sticky-active' );
285				}
286			} else {
287				if ( header_sticky_offset.top > siteheader_height + 100 ) {
288					jQuery( 'body' ).addClass( 'header-sticky-active' );
289				} else {
290					jQuery( 'body' ).removeClass( 'header-sticky-active' );
291				}	
292			}
293		});
294	}
295});
296
297
298// ----------------------------------------------------------------------------------
299//	FLUID MEDIA SIZES (Modified from http://bavotasan.com/2012/better-way-to-resize-video-using-jquery)
300// ----------------------------------------------------------------------------------
301
302// Videos
303jQuery(document).ready(function() {
304
305	/* Supported Platforms */
306	var all_videos = jQuery( 'iframe[src*="//player.vimeo.com"], iframe[src*="//www.youtube.com"], iframe[src*="//blip.tv"], iframe[src*="//www.slideshare.net"], iframe[src*="//www.scribd.com"], iframe[src*="//revision3.com"], iframe[src*="//www.hulu.com"], iframe[src*="//www.funnyordie.com"], iframe[src*="//www.dailymotion.com"], iframe[src*="//maps.google.com"], embed[src*="//v.wordpress.com"], object, embed' );
307
308	all_videos.each(function() {
309		var el = jQuery(this);
310		el
311			.attr( 'data-aspectRatio', 360 / 640 )
312			.attr( 'data-oldWidth', el.width() );
313	} );
314
315	jQuery(document).ready(function() {
316		all_videos.each( function() {
317		var el = jQuery(this),
318			newWidth    = el.parents().width(),
319			oldWidth    = el.attr( 'data-oldWidth' );
320			ratioHeight = el.height() / el.outerHeight(),
321
322			el
323				.removeAttr( 'height' )
324				.removeAttr( 'width' )
325				.width( newWidth * ratioHeight )
326				.outerHeight( newWidth * el.attr( 'data-aspectRatio' ) );
327		});
328	}).resize();
329
330	jQuery(window)
331		.resize( function() {
332			all_videos.each( function() {
333			var el = jQuery(this),
334				newWidth    = el.parents().width(),
335				oldWidth    = el.attr( 'data-oldWidth' );
336				ratioHeight = el.height() / el.outerHeight(),
337
338				el
339					.removeAttr( 'height' )
340					.removeAttr( 'width' )
341					.width( newWidth * ratioHeight )
342		    		.outerHeight( newWidth * el.attr( 'data-aspectRatio' ) );
343			});
344		}).resize();
345});
346
347// SoundCloud
348jQuery(document).ready(function() {
349
350	// Supported Platforms
351	var all_sounds = jQuery( 'iframe[src^="http://w.soundcloud.com"]' );
352
353	all_sounds.each(function() {
354		var el = jQuery(this);
355		el
356			.attr( 'data-aspectRatio', el.attr( 'height' ) / el.attr( 'width' )  )
357			.attr( 'data-oldWidth', el.width() );
358	});
359
360	jQuery(document).ready(function() {
361		all_sounds.each( function() {
362		var el = jQuery(this),
363			newWidth = el.parents().width(),
364			oldWidth = el.attr( 'data-oldWidth' );
365
366			el
367				.removeAttr( 'width' )
368				.width( newWidth )
369		});
370	}).resize();
371
372	jQuery(window)
373		.resize( function() {
374			all_sounds.each( function() {
375			var el = jQuery(this),
376				newWidth = el.parents().width(),
377				oldWidth = el.attr( 'data-oldWidth' );
378
379				el
380					.removeAttr( 'width' )
381					.width( newWidth )
382			});
383		}).resize();
384});
385
386
387// ----------------------------------------------------------------------------------
388//	ADD PRETTYPHOTO TO PORTFOLIO PAGE
389// ----------------------------------------------------------------------------------
390
391jQuery(document).ready(function() {
392	jQuery('#container.portfolio-wrapper a').has('img.hover-zoom').addClass('prettyPhoto');
393	jQuery('#container.portfolio-wrapper a').has('img.hover-zoom').attr('rel','portfolio[gallery]');
394	jQuery('a.prettyPhoto').has('img').attr('rel','portfolio[gallery]');
395	jQuery('a.prettyPhoto').prettyPhoto();
396});
397
398
399// ----------------------------------------------------------------------------------
400//	ADD PRETTYPHOTO TO POST IMAGE PAGE
401// ----------------------------------------------------------------------------------
402
403jQuery(document).ready(function() {
404	jQuery('body.attachment .entry-attachment .attachment a').has('img').addClass('prettyPhoto');
405	jQuery('a.prettyPhoto').prettyPhoto();
406});
407
408
409// ----------------------------------------------------------------------------------
410//	ADD _BLANK TO OUTGOING LINKS
411// ----------------------------------------------------------------------------------
412
413jQuery(document).ready(function(){
414	jQuery('.thinkup_widget_flickr a[href^="http://"], .thinkup_widget_flickr a[href^="https://"]').attr('target','_blank');
415	jQuery('.thinkup_widget_socialshare a[href^="http://"], .thinkup_widget_socialshare a[href^="https://"]').attr('target','_blank');
416	jQuery('.thinkup_widget_socialprofiles a[href^="http://"], .thinkup_widget_socialprofiles a[href^="https://"]').attr('target','_blank');
417	jQuery('#pre-header-social a[href^="http://"], #pre-header-social a[href^="https://"]').attr('target','_blank');
418	jQuery('#shareicons a[href^="http://"], #shareicons a[href^="https://"]').attr('target','_blank');
419});
420
421
422// ----------------------------------------------------------------------------------
423//	SHORTCODES
424// ----------------------------------------------------------------------------------
425
426jQuery(window).load(function() {
427
428	// Accordion - Fix Bootstrap Toggle Issue
429	jQuery('.accordion-toggle').click(function() {
430	    if(jQuery(this).hasClass('collapsed')) {
431	        jQuery(this).closest('.accordion').find('.accordion-toggle').not(this).addClass('collapsed');
432	    }
433	});
434
435	// Divider - Scroll To Top
436	jQuery('.backtotop').click(function(){
437		jQuery('html, body').animate({scrollTop:0}, 'slow');
438	});
439
440	// Tooltip - Activate Bootstrap
441	jQuery('[data-tip]').each( function() {jQuery(this).tooltip({ placement: jQuery(this).data('tip') }); });
442
443	// Blog Post - Carousel (used for identifying if input variable is an integer
444	function isNumber(n) {
445		return !isNaN(parseFloat(n)) && isFinite(n);
446	}
447
448	// Blog Post - Activate CarouFredSel
449	jQuery(window).bind( 'load resize', function() {
450		jQuery( '.sc-carousel' ).each( function(i) {
451
452			// Don't run caroufredsel code if the following classes are present.
453			if ( jQuery( this ).hasClass( 'sc-postitem' ) || 
454				 jQuery( this ).hasClass( 'sc-featured' ) || 
455				 jQuery( this ).hasClass( 'sc-image' ) ) {
456					return;
457			};
458
459			var instanceID = 'sc-carousel-' + i;
460
461			jQuery( this ).attr( 'id', instanceID );
462
463			jQuery( this ).children( 'ul').attr( 'id', instanceID + '-inner' );
464
465			var show   = jQuery( '#' + instanceID + '.sc-carousel' ).data( 'show' );
466			var scroll = jQuery( '#' + instanceID + '.sc-carousel' ).data( 'scroll' );
467			var speed  = jQuery( '#' + instanceID + '.sc-carousel' ).data( 'speed' );
468			var effect = jQuery( '#' + instanceID + '.sc-carousel' ).data( 'effect' );
469
470			if ( show == 0 || isNaN( show ) == true ) show = '3';
471			if ( scroll == 0 || isNaN( scroll ) == true ) scroll = '1';
472			if ( speed == 0 ) speed = '500';
473			if ( effect == 0 ) {
474				effect = '"scroll"'; 
475			} else {
476				effect = '"' + effect + '"';
477			}
478
479			var showItems = show;
480			var scrollItems = scroll;
481			var speedItems = speed;
482			var fxItems = effect;
483
484			var width = jQuery(window).width();
485
486			if ( jQuery( 'body' ).hasClass( 'layout-responsive' ) ) {
487				if(width <=685) {
488						showItems = 2;
489						if( scrollItems >= 2 ) {
490							scrollItems = 2;
491						}
492				}
493				if(width <=480) {
494					showItems = 1;
495					scrollItems = 1;
496				}
497			}
498
499				// Apply carousel code if needed				
500				if ( jQuery( this ).find( '#' + instanceID + '-inner' ).length ) {
501
502					jQuery( this ).find( '#' + instanceID + '-inner' ).carouFredSel({
503						width: '100%',
504						items			: {
505								visible         : showItems,
506								minimum         : 3,
507								minimum         : 3,
508								start: 0
509						},
510						scroll			: {
511								items           : scrollItems,
512								fx              : fxItems,
513								easing          : "swing",
514								duration        : speedItems,
515						},
516						responsive      : true,
517						circular        : true,
518						infinite        : false,
519						auto 	        : false,
520						prev	: {	
521							button	: '#' + instanceID + ' .prev',
522							key		: 'left'
523						},
524						next	: { 
525							button	: '#' + instanceID + ' .next',
526							key		: 'right'
527						},
528						pagination	: '#' + instanceID + ' .pagination',
529						onCreate: function () {
530							jQuery(window).bind("load resize", function() {
531							
532							// Set height to testimonial carousel elements - All
533							parentWidthTestimonial = jQuery( '#' + instanceID + '.carousel-testimonial li').outerHeight();
534							jQuery( '#' + instanceID + '.carousel-testimonial' ).height( 'auto' );
535							jQuery( '#' + instanceID + '.carousel-testimonial .caroufredsel_wrapper' ).css( { 'height': parentWidthTestimonial } );
536
537							// Set height to testimonial carousel elements - Fix Style 1
538							parentWidthTestimonial_1 = jQuery( '#' + instanceID + '.carousel-testimonial.style1 .caroufredsel_wrapper').outerHeight();
539							parentWidthTestimonial_2 = jQuery( '#' + instanceID + '.carousel-testimonial.style1 .sc-carousel-thumbs').outerHeight();
540
541							jQuery( '#' + instanceID + '.carousel-testimonial.style1' ).height( parentWidthTestimonial_1 + parentWidthTestimonial_2 );
542							jQuery( '#' + instanceID + '.carousel-testimonial.style1 .sc-carousel-thumbs' ).parent().height( parentWidthTestimonial_2 );
543							});
544						}
545					});
546				}
547
548				// Used for adding thumbnails to slider - Currently only for Testimonials slider
549				if ( jQuery( this ).find('.sc-carousel-thumbs').length ) {
550
551					jQuery( this ).find('.sc-carousel-thumbs').carouFredSel({
552						responsive: true,
553						circular: false,
554						infinite: false,
555						auto: false,
556						prev: '#prev',
557						next: '#next',
558						items: {
559							visible: {
560								min: 2,
561								max: 6
562							},
563							width: 150,
564							height: 70
565						}
566					});
567				}
568
569				jQuery( this ).find('.sc-carousel-thumbs a').click(function() {
570					jQuery('#' + instanceID + '-inner').trigger('slideTo', '#' + this.href.split('#').pop() );
571					jQuery('.sc-carousel-thumbs a').removeClass('selected');
572					jQuery( this ).addClass('selected');
573					return false;
574				});
575
576			// Set carousel container height
577			parentHeight = jQuery( '#' + instanceID + ' li').height();
578			jQuery( '#' + instanceID + ' li' ).each(function() {
579				var elementHeight = jQuery(this).height(); 
580				parentHeight = elementHeight > parentHeight ? elementHeight : parentHeight;
581			});
582
583			// Add addition height if carousel thumbnails are showing
584			if( jQuery( '#' + instanceID ).closest('.sc-carousel').find('.sc-carousel-thumbs').length > 0 ) {
585				parentHeightThumb = parentHeight + jQuery( '#' + instanceID ).closest('.sc-carousel').find('.sc-carousel-thumbs').height();
586			} else {
587				parentHeightThumb = parentHeight;
588			}
589
590			// Assign height to unique carousel ID (Max used to ensure thumbnail carousel displays correctly)
591			jQuery( '#' + instanceID ).height( Math.max( parentHeight, parentHeightThumb ) );
592			jQuery( '#' + instanceID + '-inner' ).height( parentHeight );
593			jQuery( '#' + instanceID + '-inner' ).parent().height( parentHeight );
594
595			// Set carousel container height to auto if iframe exists in featured images
596			if ( jQuery( '#' + instanceID + ' iframe').length > 0 ) {
597				jQuery( '#' + instanceID ).addClass('carousel-iframe');
598			}
599		});
600
601	}).resize();
602
603	// Progress Bar - Animate Width
604	jQuery('.progress').waypoint(
605		function(event, direction) {
606
607			var width = jQuery(this).children().attr('data-width');
608			var delay = jQuery(this).children().attr('data-delay');
609
610			jQuery(this).delay( delay ).queue(function(next){
611				jQuery(this).children().css( 'width', width + '%' );
612			});
613		}, {
614		offset: 'bottom-in-view'
615	});
616
617	// Progress Knob - Triggers and adds a delay is set by user
618	jQuery(document).ready(function() {
619
620		// Trigger knob so that input box doesn't show (with percentage)
621		jQuery( '.sc-knob:not(.sc-counter) .sc-knob-dial' ).knob({
622			  'draw' : function () {
623				jQuery(this.i).val(this.cv + '%');
624			  }
625		})
626
627		// Trigger knob so that input box doesn't show (without percentage)
628		jQuery( '.sc-knob.sc-counter .sc-knob-dial' ).knob({
629			  'draw' : function () {
630				jQuery(this.i).val(this.cv);
631			  }
632		})
633
634		// Trigger waypoint for all knobs
635		jQuery( '.sc-knob' ).waypoint(
636		function(event, direction) {
637			jQuery('.sc-knob .sc-knob-dial').each( function(i) {
638
639			var instanceID = 'sc-knob-' + i;
640
641			jQuery( this ).attr( 'id', instanceID );
642
643				var input_time = jQuery( '#sc-knob-' + i ).attr('data-delay');
644				var input_value = jQuery( '#sc-knob-' + i ).attr('data-value');
645
646				setTimeout(function() {
647					jQuery({
648						value: 0
649					}).animate({
650						value: input_value
651					}, {
652						duration: 2000,
653						easing: 'swing',
654						step: function() {
655							return jQuery('#sc-knob-' + i).val(Math.ceil(this.value)).trigger('change');
656						}
657					});
658				}, input_time );
659			});
660		}, {
661		offset: 'bottom-in-view',
662		triggerOnce: true
663		});
664	});
665});
666
667jQuery(document).ready(function() {
668
669	// Make slider full width if specified
670	jQuery( '.rslides-sc' ).each(function( index, element ){
671
672		jQuery( element ).attr( 'id', 'thinkupbuilder-sliderimage-' + index );
673
674			// Collect slider parameter values
675			var wide = jQuery( element ).data( 'wide' );
676			
677			// Format row section for full-screen slider
678			if ( wide == 'on' ) {		
679				jQuery( element ).closest( '.panel-grid' ).css( 'padding', 0 );
680				jQuery( element ).closest( '.panel-grid-core' ).css( 'margin', 0 ).css( 'maxWidth', '100%' );
681				jQuery( element ).closest( '.panel-grid-cell' ).css( 'padding', 0 );
682			}
683	});
684
685	// Make ThinkUpSlider shortcode full width if specified
686	jQuery( '.thinkupslider-sc' ).each(function( index, element ){
687
688		jQuery( element ).attr( 'id', 'thinkupbuilder-thinkupsliderimage-' + index );
689
690			// Collect slider parameter values
691			var wide = jQuery( element ).data( 'wide' );
692			
693			// Format row section for full-screen slider
694			if ( wide == 'on' ) {		
695				jQuery( element ).closest( '.panel-grid' ).css( 'padding', 0 );
696				jQuery( element ).closest( '.panel-grid-core' ).css( 'margin', 0 ).css( 'maxWidth', '100%' );
697				jQuery( element ).closest( '.panel-grid-cell' ).css( 'padding', 0 );
698			}
699	});
700
701	// Make image grid full width if specified
702	jQuery( '.sc-grid ul' ).each(function( index, element ){
703
704			// Collect slider parameter values
705			var wide = jQuery( element ).data( 'wide' );
706			
707			// Format row section for full-screen slider
708			if ( wide == 'on' ) {		
709				jQuery( element ).closest( '.panel-grid' ).css( 'padding', 0 );
710				jQuery( element ).closest( '.panel-grid-core' ).css( 'margin', 0 ).css( 'maxWidth', '100%' );
711				jQuery( element ).closest( '.panel-grid-cell' ).css( 'padding', 0 );
712			}
713	});
714});
715
716
717// ----------------------------------------------------------------------------------
718//	SHORTCODES - WAYPOINTS ANIMATION
719// ----------------------------------------------------------------------------------
720
721jQuery(document).ready(function() {
722
723	jQuery('.anim-start-ltr').waypoint(
724		function(event, direction) {
725		var time = jQuery(this).parent().attr('title');
726
727			jQuery(this).delay( time ).queue(function(next){
728				jQuery(this).removeClass( 'anim-start-ltr' ).addClass( 'anim-end-ltr' );
729				jQuery(this).parent().removeAttr( 'title' );
730			});	
731		}, {	
732		offset: 'bottom-in-view'
733	});
734
735	jQuery('.anim-start-rtl').waypoint(
736		function(event, direction) {
737		var time = jQuery(this).parent().attr('title');
738
739			jQuery(this).delay( time ).queue(function(next){
740				jQuery(this).removeClass( 'anim-start-rtl' ).addClass( 'anim-end-rtl' );
741				jQuery(this).parent().removeAttr( 'title' );
742			});	
743		}, {
744		offset: 'bottom-in-view'
745	});
746
747	jQuery('.anim-start-btt').waypoint(
748		function(event, direction) {
749		var time = jQuery(this).parent().attr('title');
750
751			jQuery(this).delay( time ).queue(function(next){
752				jQuery(this).removeClass( 'anim-start-btt' ).addClass( 'anim-end-btt' );
753				jQuery(this).parent().removeAttr( 'title' );
754			});	
755		}, {
756		offset: 'bottom-in-view'
757	});
758
759	jQuery('.anim-start-ttb').waypoint(
760		function(event, direction) {
761		var time = jQuery(this).parent().attr('title');
762
763			jQuery(this).delay( time ).queue(function(next){
764				jQuery(this).removeClass( 'anim-start-ttb' ).addClass( 'anim-end-ttb' );
765				jQuery(this).parent().removeAttr( 'title' );
766			});
767		}, {
768		offset: 'bottom-in-view'
769	});
770
771	jQuery('.anim-start-stb').waypoint(
772		function(event, direction) {
773		var time = jQuery(this).parent().attr('title');
774
775			jQuery(this).delay( time ).queue(function(next){
776				jQuery(this).removeClass( 'anim-start-stb' ).addClass( 'anim-end-stb '+ time );
777				jQuery(this).parent().removeAttr( 'title' );
778			});
779		}, {
780		offset: 'bottom-in-view'
781	});
782
783});
784
785
786// ----------------------------------------------------------------------------------
787//	HEADER SEARCH
788// ----------------------------------------------------------------------------------
789
790jQuery(document).ready(function() {
791	jQuery('#header-search a').click(function() {	
792		if ( ! jQuery( '#header-search' ).hasClass( 'active' ) ) {
793			jQuery( '#header-search' ).addClass( 'active' );
794		} else { 
795			jQuery( '#header-search' ).removeClass( 'active' );	
796		}
797	});
798});
799
800
801// ----------------------------------------------------------------------------------
802//	SCROLL TO TOP BUTTON
803// ----------------------------------------------------------------------------------
804
805jQuery(document).ready(function() {
806	if ( jQuery( 'body' ).hasClass( 'scrollup-on' ) ) {
807		(function($) {
808			$(function () {
809				$.scrollUp({
810				scrollName: 'scrollUp', // Element ID
811				scrollText: '', // Text for element, can contain HTML
812			});
813		});
814		} (jQuery) );
815	}
816});
817
818
819// ----------------------------------------------------------------------------------
820//	SUB-FOOTER WIDGETS - CLOSE BUTTON
821// ----------------------------------------------------------------------------------
822
823// Sub-Footer Widget - Close Button
824jQuery('#sub-footer-close-core').click(function() {
825    if(jQuery( this ).hasClass('collapsed')) {
826        jQuery( this ).removeClass('collapsed');
827        jQuery( '#sub-footer-widgets' ).removeClass('collapsed');
828    } else {
829        jQuery( this ).addClass('collapsed');
830        jQuery( '#sub-footer-widgets' ).addClass('collapsed');
831	}
832});
833
834
835// ----------------------------------------------------------------------------------
836//	SLIDER ICON - SMOOTH SCROLL
837// ----------------------------------------------------------------------------------
838
839jQuery(document).ready(function (){
840
841	// Add #thinkupslider-after
842	if ( jQuery( '.featured-icon' ) ) {
843		jQuery( '#slider' ).after( '<div id="thinkupslider-after"></div>' );
844	}
845
846	// Scroll To #thinkupslider-after
847	jQuery('.featured-icon a').click(function(e){
848		e.preventDefault(); 
849		jQuery('html, body').animate( { scrollTop: jQuery( '#thinkupslider-after' ).offset().top },  1000 );
850	});
851});
852
853
854// ----------------------------------------------------------------------------------
855//	WOOCOMMERCE - SOCIAL SHARING
856// ----------------------------------------------------------------------------------
857
858jQuery(document).ready(function (){
859
860	// Add active class to social sharing button
861	jQuery('.woo-share').click(function(e){ 
862	
863		if ( jQuery( this ).hasClass( 'active' ) ) {
864			jQuery( this ).removeClass( 'active' );
865			jQuery( this ).closest( '.woo-meta' ).find( '.woo-meta-social' ).removeClass( 'active' );
866		} else {
867			jQuery( this ).addClass( 'active' );
868			jQuery( this ).closest( '.woo-meta' ).find( '.woo-meta-social' ).addClass( 'active' );
869		}
870	});
871});

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.