PageSourceSearch

https://www.albanydoors.us/js/scripts.js?v=02162024a

js albanydoors.us collected 2026-10-09 21:46:58 UTC 12,520 bytes, 438 lines download raw bytes

1// call jRespond and add breakpoints
2var jRes = jRespond([
3    {
4        label: 'mobile',
5        enter: 0,
6        exit: 767
7    },{
8        label: 'tablet',
9        enter: 768,
10        exit: 1199
11    },{
12        label: 'desktop',
13        enter: 1200,
14        exit: 10000
15    }
16]);
17
18$(document).ready(function(){
19    
20    $('#noLink').click(function(e){
21        e.preventDefault();
22    });
23
24	// Desktop
25	jRes.addFunc({
26	    breakpoint: ['desktop'],
27	    enter: function() {
28			// Desktop Primary Navigation Dropdowns
29			$('#primary-nav > li').hoverIntent(primaryNavConfig);
30			$("body").addClass("desktop");
31	    },
32	    exit: function() {
33			$('#primary-nav > li').hoverIntent();
34			$("body").removeClass("desktop");
35	    }
36	});
37	
38	// Tablet & Mobile
39	jRes.addFunc({
40	    breakpoint: ['tablet','mobile'],
41	    enter: function() {
42		    $("#primary-nav").appendTo("#mobile-menu");
43		    $('.nav-tabs').click(function(){
44            	$(this).toggleClass("open");
45        	});
46        	
47        	$("#header #header-top .constrain .logo").prependTo("#header #header-bottom .constrain");
48        	$("body").addClass("mobile");
49        	$("#header #header-bottom .constrain .search-container").prependTo("#mobile-menu");
50	    },
51	    exit: function() {
52		    $("#primary-nav").prependTo("#header nav");
53			$("#primary-nav > li").hoverIntent(primaryNavConfig);
54			$("#header #header-bottom .constrain .logo").prependTo("#header #header-top .constrain");
55			$("body").removeClass("mobile");
56			$("#mobile-menu .search-container").appendTo("#header #header-bottom .constrain");
57	    }
58	});
59	
60	// Mobile Navigation
61	$("#primary-toggle").click(function(){
62		$(this).toggleClass("active");
63	    $("#mobile-menu").toggleClass("open");
64		$("#primary-nav ul").removeClass("active");
65		$("html").addClass("noscroll");
66
67	});
68	
69	$("#search-toggle").click(function(){
70		$(this).toggleClass("active");
71	    $("#mobile-menu").toggleClass("open");
72		$("#primary-nav ul").removeClass("active");
73		$("html").addClass("noscroll");
74
75	});
76	
77	$("#close-toggle").click(function(){
78		$("#primary-toggle").removeClass("active");
79	    $("#mobile-menu").removeClass("open");			    
80		$("#primary-nav ul").removeClass("active");
81		$("html").removeClass("noscroll");
82	});
83	
84	
85	$("#search-toggle").click(function(){
86		$("#header-bottom .constrain .search-container").toggleClass("open");
87	});
88	
89	$("#primary-nav li").click(function(){
90	    if($("#primary-nav li ul").hasClass("active")){
91			$("#primary-close").addClass("hide");
92		} else {
93			$("#primary-close").removeClass("hide");
94		}
95	});
96	
97	$('#home-jumplink').click(function(){
98        $('body,html').animate({
99            scrollTop: 550
100        }, 800);
101        return false;
102    });	
103	
104	$("#primary-nav li > i").not("li.back > i").click(function(){
105		var sibling = $(this).next('ul');	
106		$(sibling).toggleClass("active");
107		$(this).parent().toggleClass("open");
108	});
109	
110	$("#primary-nav li.back").click(function(){
111		var parent = $(this).parent();
112		
113		$(parent).removeClass("active");
114	});
115	
116	$("#overlay").click(function(){
117		$("#primary-toggle").removeClass("active");
118	    $("#primary-nav").removeClass("open");			    
119		$("#primary-nav ul").removeClass("active");
120		$("html").removeClass("noscroll");
121	    $(this).hide();
122	});
123	
124	$(window).scroll(function (){
125		// Header
126		if($(this).scrollTop() > 35){
127			$("#header").addClass("scrolling");
128		}else {
129			$("#header").removeClass("scrolling");
130		}
131	});
132	
133	$("#primary-nav .parent >ul >li a").hover(
134		function(){
135			if(!$(this).attr("data-description")){
136				$("#primary-nav .parent .test p").text("Hover over a door model to learn more about it.");
137			}
138			else{
139				$("#primary-nav .parent .test p").text($(this).attr("data-description"));
140			}
141		},
142		function(){
143			$("#primary-nav .parent .test p").text("Hover over a door model to learn more about it.");
144		}
145	);
146	
147	//Flexslider
148	if($.isFunction($.fn.flexslider)){ 
149		$("#home-banner").flexslider({
150            controlNav: true,
151            directionNav: true,
152            slideshow: true,
153            pauseOnHover: false
154        });
155 		if($('.gallery.slider.has-pager').length){
156	 		var controlNav = true;
157 		}else{
158	 		var controlNav = false;
159 		}
160 		if($('.gallery.slider.has-arrows').length){
161	 		var directionNav = true;
162 		}else{
163	 		var directionNav = false;
164 		}
165 		if($('.gallery.slider .fancybox').length){
166	 		var selector = '.slides > a';
167 		}else{
168	 		var selector = '.slides > .img-wrapper';
169 		}
170 		$('.gallery.slider').flexslider({
171            controlNav: controlNav,
172            directionNav: directionNav,
173            slideshow: true,
174            pauseOnHover: false,
175			selector: selector
176        });
177 		$('.gallery.content').flexslider({
178            controlNav: true,
179            directionNav: true,
180            slideshow: true,
181            pauseOnHover: false,
182			selector: '.block'
183        });
184	}
185	
186	//Slick Carousel
187	if($.isFunction($.fn.slick)){
188
189		// Initialize objects to store each iteration of each slick slider
190		// Necessary if we have more than one slick slider per page
191		var numSlick = 0;
192		var dots = {};
193		var arrows = {};
194		var countD = {};
195		var countT = {};
196		var countM = {};
197		
198		// Iterate through every carousel and check each setting
199		$('.gallery.carousel').each(function(){
200			numSlick++;
201			if($(this).hasClass("has-pager")){
202		 		dots[numSlick] = true;
203	 		}else{
204		 		dots[numSlick] = false;
205	 		}
206	 		if($(this).hasClass("has-arrows")){
207		 		arrows[numSlick] = true;
208	 		}else{
209		 		arrows[numSlick] = false;
210	 		}
211			countD[numSlick] = parseInt($(this).attr('data-count'));
212			countT[numSlick] = countD[numSlick] - 1;
213			countM[numSlick] = countT[numSlick] - 1;
214			if(countT[numSlick] <= 3){
215				countT[numSlick] = 2;
216			}
217			if(countM[numSlick] <= 2){
218				countM[numSlick] = 2;
219			}
220			$(this).slick({
221				slidesToShow: countD[numSlick],
222				slidesToScroll: countT[numSlick],
223				dots: dots[numSlick],
224				arrows: arrows[numSlick],
225				responsive: [{
226					breakpoint: 1199,
227					settings: {
228						slidesToShow: 3,
229						slidesToScroll: 2
230					},
231					breakpoint: 767,
232					settings: {
233						slidesToShow: 2,
234						slidesToScroll: 1
235					}
236				}]
237			});
238		});		
239	}
240	
241		
242	//Content Blocks Tabbed Content
243	if($('.tabbed-content').length){
244		$('.tab-pane').each(function(){
245			var title = $(this).attr('data-title');
246			var href = $(this).attr('id');
247			$(this).closest('.tabbed-content').find('.nav-tabs').append('<li><a data-toggle="tab" href="#'+href+'">'+title+'</a></li>');
248			$('.nav-tabs li:first').addClass("active");
249		});
250	}
251	
252	//Shifty Form Labels
253	/*$('form .input-group input, form .input-group select, form .input-group textarea').focusin(function(){
254		$(this).parents('.input-group').find('label').removeClass('hidden').addClass('focus');
255	}).focusout(function(){
256		$('form .input-group input, form .input-group select, form .input-group textarea').each(function(){
257			if($(this).val() === '') {
258				$(this).parents('.input-group').find('label').removeClass('focus');			
259			} else {
260				$(this).parents('.input-group').find('label').addClass('hidden');			
261			}
262		});
263	}).blur();
264	$('form .input-group label').click(function(){
265		$(this).parents('.input-group').find('input,select,textarea').focus();
266	});	*/
267	
268	// Faux Links
269    $('.fauxlink').click(function(){
270		var href = '/' + $(this).find('a').attr('href');
271		if ($(this).find('a').attr('target') != '_blank'){
272			window.location.href = href;
273		} else {
274			window.open(href,'_blank');	
275		}
276	});
277	
278	// Anchor Link Animations
279    $("#back-top").click(function (){
280        $("body,html").animate({
281            scrollTop: 0
282        }, 800);
283        return false;
284    });
285    
286    
287    var containerEl = document.querySelector('.mix-container');	
288    if($(containerEl).length){
289	    var mixer = mixitup(containerEl, {
290		    pagination: {
291		        limit: 12
292		    }
293		});
294	}
295    	
296	//Fancybox for Gallery and Video
297	if($.isFunction($.fn.fancybox)){
298		$(".fancybox").fancybox({
299			infobar: true,
300			loop: true,
301			afterLoad: function( instance, current ) {
302			    var text = $('.fancybox-inner > .fancybox-caption-wrap .fancybox-caption').text();
303			    $('.fancybox-container .fancybox-slide--current').each(function(){
304			        if(!$(this).find('.fancybox-image-wrap .fancybox-caption').length){
305			            $(this).find('.fancybox-image-wrap').append("<div class='fancybox-caption'>"+text+"</div>");
306			        }
307			        if(!$(this).find('.fancybox-image-wrap .fancybox-infobar').length){
308			            $('.fancybox-infobar').appendTo('.fancybox-image-wrap');
309			        }
310			        if(!$(this).find('.fancybox-image-wrap .fancybox-button--close').length){
311			            $('.fancybox-button--close').prependTo('.fancybox-image-wrap');
312			        }
313			    });
314	        }
315		});
316	}
317	
318	//Charts & Graphs
319    /* To animate: <script src="//cdnjs.cloudflare.com/ajax/libs/waypoints/2.0.3/waypoints.min.js"></script> <script src="/js/jquery.counterup.min.js"></script>*/
320	
321	if($.isFunction($.fn.counterUp)){	
322		$(".percent .number,.statistic .number").counterUp({
323	        delay: 10,
324	        time: 700
325	    });
326	}
327
328	$(".percent .caption").each(function() {
329		var text = $(this);
330	    var words = $(this).text().split(" ");
331	    
332	    if (words.length >= 6) {
333			$(this).addClass("long");
334	    }
335	});	 
336
337	
338    // IE Placeholder/Value
339    $("[placeholder]").focus(function(){
340        var input = $(this);
341        if(input.val() == input.attr("placeholder")){
342            input.val("");
343            input.removeClass("placeholder");
344        }
345    });
346    $("[placeholder]").blur(function(){
347        var input = $(this);
348        if(input.val() == "" || input.val() == input.attr("placeholder")){
349            input.addClass("placeholder");
350            input.val(input.attr("placeholder"));
351        }
352    });
353    $("[placeholder]").parents("form").submit(function(){
354        $(this).find("[placeholder]").each(function(){
355            var input = $(this);
356            if(input.val() == input.attr("placeholder")){
357                input.val("");
358            }
359        });
360    });
361   
362    
363	// Accessible Form Validation
364    $('.forms .submit').click(function (e) {
365        $("span.errorMessage").remove(".errorMessage");
366        
367        $('input.required,textarea.required,select.required').not("input#token").each(function () {
368		    var placeholder = $(this).attr("placeholder");
369	        var label = $(this).parent().find("label").text().replace('*', '');
370	        
371            $(this).removeAttr('style');
372
373            if (!this.value || $(this).val() == placeholder) {
374	            e.preventDefault();
375		            
376	        	$(this).after('<span class="errorMessage">
376Enter '+label+'<\/span>');
377	            $(this).attr('style','border:1px solid red;');
378            } else {
379            	$(this).removeAttr("aria-invalid");
380            };
381        });
382        
383        if($(this).closest("form").find('.required #file-uploader-image').length){
384            var ajaxupload = $(this).closest("form").find('.required #file-uploader-image');
385            if(!ajaxupload.find('.file-wrap').length){
386               e.preventDefault();
387               $('<span class="errorMessage">Please upload a file.</span>').insertAfter(ajaxupload);
388            }
389        }
390    });	
391    
392	if($('.sidebar').length){
393		$('.sidebar li i').click(function(){
394			$(this).next('ul').toggle();
395			$(this).parent().toggleClass('active');
396		});
397		$('.sidebar h3 i').click(function(){
398			$(this).closest('.sidebar').toggleClass('active');
399		});
400	}
401	
402	 // Cookie Policy popup for users on IE 8/9
403    if($("html").hasClass("oldie")) {
404		if(!(Cookies.get('browserIE'))){
405			console.log("Cookie set");
406			$("#update-browser").show();
407			Cookies.set('browserIE', 'visited', { expires: 7 });
408		}
409		else {
410			$("#update-browser").hide();
411			console.log("Cookie removed");
412		}	
413		$(".update-browser-close").click(function(){
414			$("#update-browser").slideUp();
415		});
416	}
417    // End Default Scripts
418});
419
420//primaryNav Hover Intent Configuration
421var primaryNavConfig = {
422    sensitivity: 10,
423    interval: 100,
424    over: primaryOver,
425    out: primaryOut,
426    timeout: 250
427};
428
429function primaryOver(){
430    $(this).find(">ul").slideDown('fast'); 
431    $(this).addClass("hover");
432    $(this).find('> a[aria-haspopup="true"]').attr("aria-expanded","true");
433}
434function primaryOut(){
435    $(this).find(">ul").slideUp('fast'); 
436    $(this).removeClass("hover"); 
437    $(this).find('> a[aria-haspopup="true"]').attr("aria-expanded","false");
438}

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.