PageSourceSearch

https://etradro.com/js/custom.js

js etradro.com collected 2026-10-08 15:27:21 UTC 16,731 bytes, 618 lines download raw bytes

1// JavaScript Document
2
3
4	$(window).on('load', function() {
5	
6		"use strict";
7
8						
9		/*----------------------------------------------------*/
10		/*	Preloader
11		/*----------------------------------------------------*/
12		
13		var preloader = $('#loading'),
14			loader = preloader.find('#loading-center-absolute');
15			loader.fadeOut();
16			preloader.delay(400).fadeOut('slow');
17				
18	});
19
20
21	$(window).on('scroll', function() {
22		
23		"use strict";
24
25								
26		/*----------------------------------------------------*/
27		/*	Navigtion Menu Scroll
28		/*----------------------------------------------------*/	
29		
30		var b = $(window).scrollTop();
31		
32		if( b > 80 ){		
33			$(".wsmainfull").addClass("scroll");
34		} else {
35			$(".wsmainfull").removeClass("scroll");
36		}				
37
38	});
39
40
41	$(document).ready(function() {
42			
43		"use strict";
44
45
46		new WOW().init();
47
48
49		/*----------------------------------------------------*/
50		/*	Mobile Menu Toggle
51		/*----------------------------------------------------*/
52
53		if ( $(window).outerWidth() < 992 ) {
54			$('.wsmenu-list li.nl-simple, .wsmegamenu li, .sub-menu li').on('click', function() {				
55				 $('body').removeClass("wsactive");	
56				 $('.sub-menu').slideUp('slow');
57     			 $('.wsmegamenu').slideUp('slow');	
58     			 $('.wsmenu-click').removeClass("ws-activearrow");
59        		 $('.wsmenu-click02 > i').removeClass("wsmenu-rotate");
60			});
61		}
62
63		if ( $(window).outerWidth() < 992 ) {
64			$('.wsanimated-arrow').on('click', function() {				
65				 $('.sub-menu').slideUp('slow');
66     			 $('.wsmegamenu').slideUp('slow');	
67     			 $('.wsmenu-click').removeClass("ws-activearrow");
68        		 $('.wsmenu-click02 > i').removeClass("wsmenu-rotate");
69			});
70		}
71
72
73		/*----------------------------------------------------*/
74		/*	ScrollUp
75		/*----------------------------------------------------*/
76		
77		$.scrollUp = function (options) {
78
79			// Defaults
80			var defaults = {
81				scrollName: 'scrollUp', // Element ID
82				topDistance: 600, // Distance from top before showing element (px)
83				topSpeed: 800, // Speed back to top (ms)
84				animation: 'fade', // Fade, slide, none
85				animationInSpeed: 200, // Animation in speed (ms)
86				animationOutSpeed: 200, // Animation out speed (ms)
87				scrollText: '', // Text for element
88				scrollImg: false, // Set true to use image
89				activeOverlay: false // Set CSS color to display scrollUp active point, e.g '#00FFFF'
90			};
91
92			var o = $.extend({}, defaults, options),
93				scrollId = '#' + o.scrollName;
94
95			// Create element
96			$('<a/>', {
97				id: o.scrollName,
98				href: '#top',
99				title: o.scrollText
100			}).appendTo('body');
101			
102			// If not using an image display text
103			if (!o.scrollImg) {
104				$(scrollId).text(o.scrollText);
105			}
106
107			// Minium CSS to make the magic happen
108			$(scrollId).css({'display':'none','position': 'fixed','z-index': '99999'});
109
110			// Active point overlay
111			if (o.activeOverlay) {
112				$("body").append("<div id='"+ o.scrollName +"-active'></div>");
113				$(scrollId+"-active").css({ 'position': 'absolute', 'top': o.topDistance+'px', 'width': '100%', 'border-top': '1px dotted '+o.activeOverlay, 'z-index': '99999' });
114			}
115
116			// Scroll function
117			$(window).on('scroll', function(){	
118				switch (o.animation) {
119					case "fade":
120						$( ($(window).scrollTop() > o.topDistance) ? $(scrollId).fadeIn(o.animationInSpeed) : $(scrollId).fadeOut(o.animationOutSpeed) );
121						break;
122					case "slide":
123						$( ($(window).scrollTop() > o.topDistance) ? $(scrollId).slideDown(o.animationInSpeed) : $(scrollId).slideUp(o.animationOutSpeed) );
124						break;
125					default:
126						$( ($(window).scrollTop() > o.topDistance) ? $(scrollId).show(0) : $(scrollId).hide(0) );
127				}
128			});
129
130		};
131		
132		$.scrollUp();
133
134
135		/*----------------------------------------------------*/
136		/*	Tabs
137		/*----------------------------------------------------*/
138
139		$('ul.tabs-1 li').on('click', function(){
140			var tab_id = $(this).attr('data-tab');
141
142			$('ul.tabs-1 li').removeClass('current');
143			$('.tab-content').removeClass('current');
144
145			$(this).addClass('current');
146			$("#"+tab_id).addClass('current');
147		});
148
149
150		/*----------------------------------------------------*/
151		/*	Masonry Grid
152		/*----------------------------------------------------*/
153
154		$('.grid-loaded').imagesLoaded(function () {
155
156	        // filter items on button click
157	        $('.masonry-filter').on('click', 'button', function () {
158	            var filterValue = $(this).attr('data-filter');
159	            $grid.isotope({
160	              filter: filterValue
161	            });
162	        });
163
164	        // change is-checked class on buttons
165	        $('.masonry-filter button').on('click', function () {
166	            $('.masonry-filter button').removeClass('is-checked');
167	            $(this).addClass('is-checked');
168	            var selector = $(this).attr('data-filter');
169	            $grid.isotope({
170	              filter: selector
171	            });
172	            return false;
173	        });
174
175	        // init Isotope
176	        var $grid = $('.masonry-wrap').isotope({
177	            itemSelector: '.masonry-image',
178	            percentPosition: true,
179	            transitionDuration: '0.7s',
180	            masonry: {
181	              // use outer width of grid-sizer for columnWidth
182	              columnWidth: '.masonry-image',
183	            }
184	        });
185	        
186	    });
187
188
189		/*----------------------------------------------------*/
190		/*	Accordion
191		/*----------------------------------------------------*/
192
193		$(".accordion > .accordion-item.is-active").children(".accordion-panel").slideDown();
194				
195		$(".accordion > .accordion-item").on('click', function() {
196			$(this).siblings(".accordion-item").removeClass("is-active").children(".accordion-panel").slideUp();
197			$(this).toggleClass("is-active").children(".accordion-panel").slideToggle("ease-out");
198		});
199
200
201		/*----------------------------------------------------*/
202		/*	Single Image Lightbox
203		/*----------------------------------------------------*/
204				
205		$('.image-link').magnificPopup({
206		  type: 'image'
207		});	
208
209
210		/*----------------------------------------------------*/
211		/*	Video Link #1 Lightbox
212		/*----------------------------------------------------*/
213		
214		$('.video-popup1').magnificPopup({
215		    type: 'iframe',		  	  
216				iframe: {
217					patterns: {
218						youtube: {			   
219							index: 'youtube.com',
220							src: 'https://www.youtube.com/embed/jakUZ6Jhe3o'				
221								}
222							}
223						}		  		  
224		});
225
226
227		/*----------------------------------------------------*/
228		/*	Video Link #2 Lightbox
229		/*----------------------------------------------------*/
230		
231		$('.video-popup2').magnificPopup({
232		    type: 'iframe',		  	  
233				iframe: {
234					patterns: {
235						youtube: {			   
236							index: 'youtube.com',
237							src: 'https://www.youtube.com/embed/n0cNf-xdKIY'				
238								}
239							}
240						}		  		  
241		});
242
243
244		/*----------------------------------------------------*/
245		/*	Video Link #3 Lightbox
246		/*----------------------------------------------------*/
247		
248		$('.video-popup3').magnificPopup({
249		    type: 'iframe',		  	  
250				iframe: {
251					patterns: {
252						youtube: {			   
253							index: 'youtube.com',
254							src: 'https://www.youtube.com/embed/jakUZ6Jhe3o'					
255								}
256							}
257						}		  		  
258		});
259
260		$('.video-popup4').magnificPopup({
261		    type: 'iframe',		  	  
262				iframe: {
263					patterns: {
264						youtube: {			   
265							index: 'youtube.com',
266							src: 'https://www.youtube.com/embed/CKpiYqwzG2Y'					
267								}
268							}
269						}		  		  
270		});
271		/*----------------------------------------------------*/
272		/*	Statistic Counter
273		/*----------------------------------------------------*/
274	
275		$('.count-element').each(function () {
276			$(this).appear(function() {
277				$(this).prop('Counter',0).animate({
278					Counter: $(this).text()
279				}, {
280					duration: 4000,
281					easing: 'swing',
282					step: function (now) {
283						$(this).text(Math.ceil(now));
284					}
285				});
286			},{accX: 0, accY: 0});
287		});
288
289
290		/*----------------------------------------------------*/
291		/*	Testimonials Rotator
292		/*----------------------------------------------------*/
293	
294		var owl = $('.reviews-1-wrapper');
295			owl.owlCarousel({
296				items: 3,
297				loop:true,
298				autoplay:true,
299				navBy: 1,
300				autoplayTimeout: 4500,
301				autoplayHoverPause: true,
302				smartSpeed: 1500,
303				responsive:{
304					0:{
305						items:1
306					},
307					767:{
308						items:1
309					},
310					768:{
311						items:2
312					},
313					991:{
314						items:3
315					},
316					1000:{
317						items:3
318					}
319				}
320		});
321
322
323		/*----------------------------------------------------*/
324		/*	Testimonials Rotator
325		/*----------------------------------------------------*/
326	
327		var owl = $('.reviews-4-wrapper');
328			owl.owlCarousel({
329				items: 2,
330				loop:true,
331				autoplay:true,
332				navBy: 1,
333				autoplayTimeout: 4500,
334				autoplayHoverPause: true,
335				smartSpeed: 1500,
336				responsive:{
337					0:{
338						items:1
339					},
340					767:{
341						items:1
342					},
343					768:{
344						items:2
345					},
346					991:{
347						items:2
348					},
349					1000:{
350						items:2
351					}
352				}
353		});
354
355
356		/*----------------------------------------------------*/
357		/*	Brands Logo Rotator
358		/*----------------------------------------------------*/
359	
360		var owl = $('.brands-carousel');
361			owl.owlCarousel({
362				items: 5,
363				loop:true,
364				autoplay:true,
365				navBy: 1,
366				nav:false,
367				autoplayTimeout: 4000,
368				autoplayHoverPause: false,
369				smartSpeed: 2000,
370				responsive:{
371					0:{
372						items:2
373					},
374					550:{
375						items:3
376					},
377					767:{
378						items:3
379					},
380					768:{
381						items:4
382					},
383					991:{
384						items:5
385					},				
386					1000:{
387						items:5
388					}
389				}
390		});
391
392
393		/*----------------------------------------------------*/
394		/*	Request Form Validation
395		/*----------------------------------------------------*/
396		
397		$(".request-form").validate({
398			rules:{ 
399					name:{
400						required: true,
401						minlength: 2,
402						maxlength: 16,
403					},
404					email:{
405						required: true,
406						email: true,
407						}
408					},
409					messages:{
410							name:{
411								required: "Please enter no less than (2) characters"
412							}, 
413							email:{
414								required: "We need your email address to contact you",
415								email: "Your email address must be in the format of [email protected]"
416							}, 
417						}
418		});
419
420
421		/*----------------------------------------------------*/
422		/*	Contact Form Validation
423		/*----------------------------------------------------*/
424		
425		$(".contact-form").validate({
426			rules:{ 
427					name:{
428						required: true,
429						minlength: 1,
430						maxlength: 16,
431					},
432					email:{
433						required: true,
434						email: true,
435					},       		
436					message:{
437						required: true,
438						minlength: 2,
439						}
440					},
441					messages:{
442							name:{
443								required: "Please enter no less than (1) characters"
444							}, 
445							email:{
446								required: "We need your email address to contact you",
447								email: "Your email address must be in the format of [email protected]"
448							}, 
449							message:{
450								required: "Please enter no less than (2) characters"
451							}, 
452						}
453		});
454
455
456		/*----------------------------------------------------*/
457		/*	Comment Form Validation
458		/*----------------------------------------------------*/
459		
460		$(".comment-form").validate({
461			rules:{ 
462					name:{
463						required: true,
464						minlength: 1,
465						maxlength: 16,
466					},
467					email:{
468						required: true,
469						email: true,
470					},       		
471					message:{
472						required: true,
473						minlength: 2,
474						}
475					},
476					messages:{
477							name:{
478								required: "Please enter no less than (1) characters"
479							}, 
480							email:{
481								required: "We need your email address to contact you",
482								email: "Your email address must be in the format of [email protected]"
483							}, 
484							message:{
485								required: "Please enter no less than (2) characters"
486							}, 
487						}
488		});	
489
490
491		/*----------------------------------------------------*/
492	    /*  Sign In Form Validation
493	    /*----------------------------------------------------*/
494	    
495	    $(".sign-in-form").validate({
496	        rules:{ 
497	                password:{
498	                    required: true,
499	                    minlength: 2,
500	                    maxlength: 16,
501	                },
502	                email:{
503	                    required: true,
504	                    email: true,
505	                    }
506	                },
507	                messages:{
508	                        password:{
509	                            required: "Please enter no less than (2) characters"
510	                        }, 
511	                        email:{
512	                            required: "Please enter valid email address",
513	                            email: "Your email address must be in the format of [email protected]"
514	                        }, 
515	                    }
516	    });
517
518
519	    /*----------------------------------------------------*/
520	    /*  Sign Up Form Validation
521	    /*----------------------------------------------------*/
522	    
523	    $(".sign-up-form").validate({
524	        rules:{ 
525	                name:{
526	                    required: true,
527	                    minlength: 2,
528	                    maxlength: 16,
529	                },
530	                password:{
531	                    required: true,
532	                    minlength: 2,
533	                    maxlength: 16,
534	                },
535	                email:{
536	                    required: true,
537	                    email: true,
538	                    }
539	                },
540	                messages:{
541	                        name:{
542	                            required: "Please enter no less than (2) characters"
543	                        },
544	                        password:{
545	                            required: "Please enter no less than (2) characters"
546	                        }, 
547	                        email:{
548	                            required: "Please enter valid email address",
549	                            email: "Your email address must be in the format of [email protected]"
550	                        }, 
551	                    }
552	    });
553
554
555	    /*----------------------------------------------------*/
556		/*	Reset Form Validation
557		/*----------------------------------------------------*/
558		
559		$(".reset-password-form").validate({
560			rules:{ 
561					email:{
562						required: true,
563						email: true,
564					},
565					messages:{
566							email:{
567								required: "We need your email address to contact you",
568								email: "Your email address must be in the format of [email protected]"
569							}, 
570						}
571			}
572		});
573
574
575		/*----------------------------------------------------*/
576		/*	Show Password
577		/*----------------------------------------------------*/
578
579	    var showPass = 0;
580	    $('.btn-show-pass').on('click', function(){
581	        if(showPass == 0) {
582	            $(this).next('input').attr('type','text');
583	            $(this).find('span.eye-pass').removeClass('flaticon-visible');
584	            $(this).find('span.eye-pass').addClass('flaticon-hidden');
585	            showPass = 1;
586	        }
587	        else {
588	            $(this).next('input').attr('type','password');
589	            $(this).find('span.eye-pass').addClass('flaticon-visible');
590	            $(this).find('span.eye-pass').removeClass('flaticon-hidden');
591	            showPass = 0;
592	        }
593	        
594	    });
595
596
597		/*----------------------------------------------------*/
598		/*	Newsletter Subscribe Form
599		/*----------------------------------------------------*/
600	
601		$('.newsletter-form').ajaxChimp({
602        language: 'cm',
603        url: 'https://dsathemes.us3.list-manage.com/subscribe/post?u=af1a6c0b23340d7b339c085b4&id=344a494a6e'
604            //http://xxx.xxx.list-manage.com/subscribe/post?u=xxx&id=xxx
605		});
606
607		$.ajaxChimp.translations.cm = {
608			'submit': 'Submitting...',
609			0: 'We have sent you a confirmation email',
610			1: 'Please enter your emai
610l address',
611			2: 'An email address must contain a single @',
612			3: 'The domain portion of the email address is invalid (the portion after the @: )',
613			4: 'The username portion of the email address is invalid (the portion before the @: )',
614			5: 'This email address looks fake or invalid. Please enter a real email address'
615		};	
616
617
618	});

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.