PageSourceSearch

https://www.stayinstandrews.com/js/custom.js

js stayinstandrews.com collected 2026-10-09 22:45:39 UTC 6,942 bytes, 295 lines download raw bytes

1/* JS Document */
2/******************************
3[Table of Contents]
41. Vars and Inits
52. Set Header
63. Init Menu
74. Init Home Slider
85. Init Timer
96. Init Tabs
107. Init Gallery
11******************************/
12$(document).ready(function()
13{
14	"use strict";
15	/* 
16	1. Vars and Inits
17	*/
18	var header = $('.header');
19	setHeader();
20	initMenu();
21	initHomeSlider();
22	initTabs();
23	initGallery();
24	initAccordions();
25	initLogosSlider();
26	$(window).on('resize', function()
27	{
28		setHeader();
29		setTimeout(function()
30		{
31			$(window).trigger('resize.px.parallax');
32		}, 375);
33	});
34	$(document).on('scroll', function()
35	{
36		setHeader();
37	});
38	/* 
39	2. Set Header
40	*/
41	function setHeader()
42	{
43		var header = $('.header');
44		if($(window).scrollTop() > 91)
45		{
46			header.addClass('scrolled');
47		}
48		else
49		{
50			header.removeClass('scrolled');
51		}
52	}
53	/* 
54	3. Init Menu
55	*/
56	function initMenu()
57	{
58		if($('.menu').length && $('.hamburger').length)
59		{
60			var menu = $('.menu');
61			var hamburger = $('.hamburger');
62			var close = $('.menu_close');
63			hamburger.on('click', function()
64			{
65				menu.toggleClass('active');
66			});
67			close.on('click', function()
68			{
69				menu.toggleClass('active');
70			});
71		}
72	}
73	/* 
74	4. Init Home Slider
75	*/
76	function initHomeSlider()
77	{
78		if($('.home_slider').length)
79		{
80			var homeSlider = $('.home_slider');
81			homeSlider.owlCarousel(
82			{
83				items:1,
84				autoplay:true,
85				autoplayTimeout:9000,
86				loop:true,
87				smartSpeed:2000,
88				animateOut: 'fadeOut',
89    			animateIn: 'fadeIn',
90				nav:false
91			});
92			/* Custom dots events */
93			if($('.home_slider_custom_dot').length)
94			{
95				$('.home_slider_custom_dot').on('click', function()
96				{
97					$('.home_slider_custom_dot').removeClass('active');
98					$(this).addClass('active');
99					homeSlider.trigger('to.owl.carousel', [$(this).index(), 1200]);
100				});
101			}
102			/* Change active class for dots when slide changes by nav or touch */
103			homeSlider.on('changed.owl.carousel', function(event)
104			{
105				$('.home_slider_custom_dot').removeClass('active');
106				$('.home_slider_custom_dots li').eq(event.page.index).addClass('active');
107			});
108		}
109	}
110	/* 
111    /* 
112	6. Init Tabs
113	*/
114	function initTabs()
115	{
116		if($('.tab').length)
117		{
118			$('.tab').on('click', function()
119			{
120				$('.tab').removeClass('active');
121				$(this).addClass('active');
122				var clickedIndex = $('.tab').index(this);
123				var panels = $('.tab_panel');
124				panels.removeClass('active');
125				$(panels[clickedIndex]).addClass('active');
126				setTimeout(function()
127				{
128					$(window).trigger('resize.px.parallax');
129				}, 375);
130			});
131		}
132	}
133	/* 
134	7. Init Gallery
135	*/
136	function initGallery()
137	{
138		if($('.gallery_item').length)
139		{
140			$('.colorbox').colorbox(
141			{
142				rel:'colorbox',
143				photo: true,
144				maxWidth:'95%',
145				maxHeight:'95%'
146			});
147		}
148	}
149	/* 
150	4. Init Accordions
151	*/
152	function initAccordions()
153	{
154		if($('.accordion').length)
155		{
156			var accs = $('.accordion');
157			accs.each(function()
158			{
159				var acc = $(this);
160				if(acc.hasClass('active'))
161				{
162					var panel = $(acc.next());
163					var panelH = panel.prop('scrollHeight') + "px";
164					if(panel.css('max-height') == "0px")
165					{
166						panel.css('max-height', panel.prop('scrollHeight') + "px");
167					}
168					else
169					{
170						panel.css('max-height', "0px");
171					} 
172				}
173				acc.on('click', function()
174				{
175					if(acc.hasClass('active'))
176					{
177						acc.removeClass('active');
178						var panel = $(acc.next());
179						var panelH = panel.prop('scrollHeight') + "px";
180						if(panel.css('max-height') == "0px")
181						{
182							panel.css('max-height', panel.prop('scrollHeight') + "px");
183						}
184						else
185						{
186							panel.css('max-height', "0px");
187						} 
188					}
189					else
190					{
191						acc.addClass('active');
192						var panel = $(acc.next());
193						var panelH = panel.prop('scrollHeight') + "px";
194						if(panel.css('max-height') == "0px")
195						{
196							panel.css('max-height', panel.prop('scrollHeight') + "px");
197						}
198						else
199						{
200							panel.css('max-height', "0px");
201						} 
202					}
203				});
204			});
205		}
206	}
207	/* 
208	6. Init Logos Slider
209	*/
210	function initLogosSlider()
211	{
212		if($('.logos_slider').length)
213		{
214			var logosSlider = $('.logos_slider');
215			logosSlider.owlCarousel(
216			{
217				items:1,
218				loop:true,
219				autoplay:true,
220				smartSpeed:1200,
221				nav:false,
222				dots:false,
223				responsive:
224				{
225					0:{items:1},
226					769:{items:1},
227					992:{items:1},
228					1200:{items:1}
229				}
230			});
231		}
232	}
233// *******************************
234    // :: 7.0 Rooms Slides Active Code
235    // *******************************
236    if ($.fn.owlCarousel) {
237        var roomSlides = $('.rooms-slides');
238        roomSlides.owlCarousel({
239            items: 1,
240            margin: 0,
241            loop: true,
242            autoplay: true,
243            smartSpeed: 1500,
244            nav: true,
245            navText: [('<i class="fa fa-long-arrow-left" aria-hidden="true"></i> Previous'), ('Next <i class="fa fa-long-arrow-right" aria-hidden="true"></i>')]
246        });
247        roomSlides.on('translate.owl.carousel', function () {
248            var layer = $("[data-animation]");
249            layer.each(function () {
250                var anim_name = $(this).data('animation');
251                $(this).removeClass('animated ' + anim_name).css('opacity', '0');
252            });
253        });
254        $("[data-delay]").each(function () {
255            var anim_del = $(this).data('delay');
256            $(this).css('animation-delay', anim_del);
257        });
258        $("[data-duration]").each(function () {
259            var anim_dur = $(this).data('duration');
260            $(this).css('animation-duration', anim_dur);
261        });
262        roomSlides.on('translated.owl.carousel', function () {
263            var layer = roomSlides.find('.owl-item.active').find("[data-animation]");
264            layer.each(function () {
265                var anim_name = $(this).data('animation');
266                $(this).addClass('animated ' + anim_name).css('opacity', '1');
267            });
268        });
269    };
270
271    function anchorListing(){
272        $("#closequicklink").click(function(){
273        	$(".quicklink").hide();
274        });
275    };anchorListing();
276
277    /*function Imginit() {
278var imgDefer = document.getElementsByTagName('img');
279for (var i=0; i<imgDefer.length; i++) {
280if(imgDefer[i].getAttribute('data-src')) {
281imgDefer[i].setAttribute('src',imgDefer[i].getAttribute('data-src'));
282} } }
283window.onload = Imginit;
284	
285	
286    $('.modal').on('show.bs.modal', function (e) {
287    if($(e.currentTarget).attr("data-popup")){
288        $("body").addClass("body-scrollable");
289    }
290	});
291	$('.modal').on('hidden.bs.modal', function (e) {
292	    $("body").removeClass("body-scrollable");
293	});*/
294
295});

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.