PageSourceSearch

https://irietoursjamaica.com/wp-content/themes/transfers/js/scripts.js?ver=2.10

js irietoursjamaica.com collected 2026-10-09 21:19:55 UTC 4,626 bytes, 173 lines download raw bytes

1(function($){
2
3	"use strict";
4	  
5	$(document).ready(function () {
6		window.transfers.init();
7	});
8	
9	$(window).load(function () {
10		window.transfers.load();
11	});
12	
13	
14	window.transfers = {
15	
16		init: function () {
17			
18			// MOBILE MENU
19			$('.main-nav').slicknav({
20				prependTo:'.header .wrap',
21				allowParentLinks : true,
22				label:''
23			});
24			
25			// CUSTOM FORM ELEMENTS
26			$('input[type=radio], input[type=checkbox],input[type=number]').uniform();
27			$('select').not('.woocommerce select').uniform();
28			
29			// SEARCH RESULTS 
30			$('.information').hide();
31			$('.trigger').on('click', function () {
32				$(this).parent().parent().nextAll('.information').slideToggle(500);
33			});
34			$('.close').on('click', function () {
35			   $('.information').hide(500);
36			});	
37			
38			// FAQS
39			$('.faqs dd').hide();
40			$('.faqs dt').on('click', function () {
41				$(this).next('.faqs dd').slideToggle(500);
42				$(this).toggleClass('expanded');
43			});
44			
45			// TABS
46			$('.tab-content').hide();
47			$('.tab-content:first-of-type').show();
48			$('.tabs li:first-of-type').addClass('active');
49
50			$('.tabs a').on('click', function (e) {
51				e.preventDefault();
52				$(this).closest('li').addClass('active').siblings().removeClass('active');
53				$($(this).attr('href')).show().siblings('.tab-content').hide();
54			});
55			
56			// SERVICES
57			$('.services-list .single').hide().first().show();
58			$('.categories li:first').addClass('active');
59
60			$('.categories a').on('click', function (e) {
61				$('div.success').hide();				
62				$('div.error').hide();
63				$(this).closest('li').addClass('active').siblings().removeClass('active');
64				$($(this).attr('href')).show().siblings('.single').hide();
65				e.preventDefault();
66			});
67
68			var hash = $.trim( window.location.hash );
69			if (hash) $('.categories a[href$="'+hash+'"]').trigger('click');
70			if (hash) $('.tabs a[href$="'+hash+'"]').trigger('click');
71			
72			// SMOOTH ANCHOR SCROLLING
73			var $root = $('body,html');
74			$('a.anchor').on('click', function(e) {
75				var href = $.attr(this, 'href');
76				if (href.startsWith('#') && typeof ($(href)) != 'undefined') {
77					href = href.substring(href.lastIndexOf("#") + 1);
78					var selector = '#' + href + ',.' + href;
79					if ($(selector).length > 0) {
80					
81						var heightOffset = $('header.header').height();
82						if ($('#wpadminbar').length > 0) {
83							heightOffset = heightOffset + $('#wpadminbar').height();
84						}
85							
86						var scrollTo = $(selector).offset().top - heightOffset;
87							
88						$root.animate({
89							scrollTop: scrollTo
90						}, 500, function () {
91							// window.location.hash = '#' + href;
92						});
93					}
94					e.preventDefault();					
95				}		
96			});
97			
98			if (hash == '#booking') $('a.anchor').trigger('click');			
99		
100			window.transfers.resizeFluidItems();
101		},
102		load: function () {
103			// UNIFY HEIGHT
104			var maxHeight = 0;
105				
106			$('.heightfix').each(function(){
107				if ($(this).height() > maxHeight) { maxHeight = $(this).height(); }
108			});
109			$('.heightfix').height(maxHeight);	
110
111			// PRELOADER
112			$('.preloader').fadeOut();
113		},
114		numberFormatI18N : function (number) {
115
116			var formattedNumber = '';
117		
118			$.ajax({
119				url: TransfersAjax.ajaxurl,
120				data: {
121					'action':'number_format_i18n_request',
122					'number' : number,
123					'nonce' : TransfersAjax.nonce
124				},
125				async: false,
126				success:function(data) {
127				
128					formattedNumber = data;
129		
130				},
131				error: function(errorThrown){
132					console.log(errorThrown);
133				}
134			}); 
135			
136			return formattedNumber;
137		},
138		resizeFluidItems: function() {
139			window.transfers.resizeFluidItem(".location-list .one-fourth");
140			window.transfers.resizeFluidItem(".one-half .post");
141		},
142		resizeFluidItem : function (filters) {
143		
144			var filterArray = filters.split(',');
145			
146			var arrayLength = filterArray.length;
147			for (var i = 0; i < arrayLength; i++) {
148				var filter = filterArray[i];
149				var maxHeight = 0;            
150				if ($(filter + ' .description div').length > 0) {
151					$(filter + " .description div").each(function(){
152						if ($(this).height() > maxHeight) { 
153							maxHeight = $(this).height(); 
154						}
155					});
156				} else if ($(filter + ' .entry-content').length > 0) {
157					$(filter + " .entry-content").each(function(){
158						if ($(this).height() > maxHeight) { 
159							maxHeight = $(this).height(); 
160						}
161					});				
162				}
163				
164				if ($(filter + ' .description div').length > 0) {
165					$(filter + ":not(.fluid-item) .description div").height(maxHeight);   
166				} else if ($(filter + ' .entry-content').length > 0) {
167					$(filter + ":not(.fluid-item) .entry-content").height(maxHeight);   
168				}
169			}
170		}
171	};
172
173})(jQuery);

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.