PageSourceSearch

https://labdoc.ir/wp-content/themes/laborex/assets/js/script.js?ver=1790958857

js labdoc.ir collected 2026-10-03 02:53:08 UTC 10,028 bytes, 431 lines download raw bytes

1(function($) {
2	
3	"use strict";
4	
5	//Hide Loading Box (Preloader)
6	function handlePreloader() {
7		if($('.loader-wrap').length){
8			$('.loader-wrap').delay(200).fadeOut(100);
9		}
10	}
11
12	if ($(".preloader-close").length) {
13        $(".preloader-close").on("click", function(){
14            $('.loader-wrap').delay(200).fadeOut(200);
15        })
16    }
17	
18	//Update Header Style and Scroll to Top
19	function headerStyle() {
20		if($('.main-header').length){
21			var windowpos = $(window).scrollTop();
22			var siteHeader = $('.main-header');
23			var scrollLink = $('.scroll-top');
24			if (windowpos >= 110) {
25				siteHeader.addClass('fixed-header');
26				scrollLink.addClass('open');
27			} else {
28				siteHeader.removeClass('fixed-header');
29				scrollLink.removeClass('open');
30			}
31		}
32	}
33	
34	headerStyle();
35
36
37
38	$('.menu-item-has-children').addClass('dropdown');
39
40	//Submenu Dropdown Toggle
41	if($('.main-header li.dropdown ul').length){
42		$('.main-header .navigation li.dropdown').append('<div class="dropdown-btn"><span class="fas fa-angle-down"></span></div>');
43		
44	}
45
46
47
48	//Mobile Nav Hide Show
49	if($('.mobile-menu').length){
50		
51		$('.mobile-menu .menu-box').mCustomScrollbar();
52		
53		var mobileMenuContent = $('.main-header .menu-area .main-menu').html();
54		$('.mobile-menu .menu-box .menu-outer').append(mobileMenuContent);
55		$('.sticky-header .main-menu').append(mobileMenuContent);
56		
57		//Dropdown Button
58		$('.mobile-menu li.dropdown .dropdown-btn').on('click', function() {
59			$(this).toggleClass('open');
60			$(this).prev('ul').slideToggle(500);
61		});
62		//Dropdown Button
63		$('.mobile-menu li.dropdown .dropdown-btn').on('click', function() {
64			$(this).prev('.megamenu').slideToggle(900);
65		});
66		//Menu Toggle Btn
67		$('.mobile-nav-toggler').on('click', function() {
68			$('body').addClass('mobile-menu-visible');
69		});
70
71		//Menu Toggle Btn
72		$('.mobile-menu .menu-backdrop,.mobile-menu .close-btn').on('click', function() {
73			$('body').removeClass('mobile-menu-visible');
74		});
75	}
76
77
78	// Scroll to a Specific Div
79	if($('.scroll-to-target').length){
80		$(".scroll-to-target").on('click', function() {
81			var target = $(this).attr('data-target');
82		   // animate
83		   $('html, body').animate({
84			   scrollTop: $(target).offset().top
85			 }, 1000);
86	
87		});
88	}
89
90	// Elements Animation
91	if($('.wow').length){
92		var wow = new WOW({
93		mobile:       false
94		});
95		wow.init();
96	}
97
98	//Contact Form Validation
99	if($('#contact-form').length){
100		$('#contact-form').validate({
101			rules: {
102				username: {
103					required: true
104				},
105				email: {
106					required: true,
107					email: true
108				},
109				phone: {
110					required: true
111				},
112				subject: {
113					required: true
114				},
115				message: {
116					required: true
117				}
118			}
119		});
120	}
121
122	//Fact Counter + Text Count
123	if($('.count-box').length){
124		$('.count-box').appear(function(){
125	
126			var $t = $(this),
127				n = $t.find(".count-text").attr("data-stop"),
128				r = parseInt($t.find(".count-text").attr("data-speed"), 10);
129				
130			if (!$t.hasClass("counted")) {
131				$t.addClass("counted");
132				$({
133					countNum: $t.find(".count-text").text()
134				}).animate({
135					countNum: n
136				}, {
137					duration: r,
138					easing: "linear",
139					step: function() {
140						$t.find(".count-text").text(Math.floor(this.countNum));
141					},
142					complete: function() {
143						$t.find(".count-text").text(this.countNum);
144					}
145				});
146			}
147			
148		},{accY: 0});
149	}
150
151
152	//LightBox / Fancybox
153	if($('.lightbox-image').length) {
154		$('.lightbox-image').fancybox({
155			openEffect  : 'fade',
156			closeEffect : 'fade',
157			helpers : {
158				media : {}
159			}
160		});
161	}
162
163
164	//Tabs Box
165	if($('.tabs-box').length){
166		$('.tabs-box .tab-buttons .tab-btn').on('click', function(e) {
167			e.preventDefault();
168			var target = $($(this).attr('data-tab'));
169			
170			if ($(target).is(':visible')){
171				return false;
172			}else{
173				target.parents('.tabs-box').find('.tab-buttons').find('.tab-btn').removeClass('active-btn');
174				$(this).addClass('active-btn');
175				target.parents('.tabs-box').find('.tabs-content').find('.tab').fadeOut(0);
176				target.parents('.tabs-box').find('.tabs-content').find('.tab').removeClass('active-tab');
177				$(target).fadeIn(300);
178				$(target).addClass('active-tab');
179			}
180		});
181	}
182
183
184
185	//Accordion Box
186	if($('.accordion-box').length){
187		$(".accordion-box").on('click', '.acc-btn', function() {
188			
189			var outerBox = $(this).parents('.accordion-box');
190			var target = $(this).parents('.accordion');
191			
192			if($(this).hasClass('active')!==true){
193				$(outerBox).find('.accordion .acc-btn').removeClass('active');
194			}
195			
196			if ($(this).next('.acc-content').is(':visible')){
197				return false;
198			}else{
199				$(this).addClass('active');
200				$(outerBox).children('.accordion').removeClass('active-block');
201				$(outerBox).find('.accordion').children('.acc-content').slideUp(300);
202				target.addClass('active-block');
203				$(this).next('.acc-content').slideDown(300);	
204			}
205		});	
206	}
207
208
209	// single-item-carousel
210	if ($('.single-item-carousel').length) {
211		$('.single-item-carousel').owlCarousel({
212			loop:true,
213			margin:30,
214			nav:false,
215			smartSpeed: 500,
216			autoplay: 1000,
217			navText: [ '<span class="icon-19"></span>', '<span class="icon-18"></span>' ],
218			responsive:{
219				0:{
220					items:1
221				},
222				480:{
223					items:1
224				},
225				600:{
226					items:1
227				},
228				800:{
229					items:1
230				},			
231				1200:{
232					items:1
233				}
234
235			}
236		});    		
237	}
238
239
240
241	// Four Item Carousel
242	if ($('.project-carousel').length) {
243		$('.project-carousel').owlCarousel({
244			loop:true,
245			margin:20,
246			nav:true,
247			smartSpeed: 500,
248			autoplay: 1000,
249			navText: [ '<span class="icon-19"></span>', '<span class="icon-18"></span>' ],
250			responsive:{
251				0:{
252					items:1
253				},
254				600:{
255					items:2
256				},
257				800:{
258					items:3
259				},
260				1024:{
261					items:4
262				},
263				1200:{
264					items:4
265				}
266			}
267		});    		
268	}
269
270
271	//Search Popup
272	if($('#search-popup').length){
273		
274		//Show Popup
275		$('.search-toggler').on('click', function() {
276			$('#search-popup').addClass('popup-visible');
277		});
278		$(document).keydown(function(e){
279	        if(e.keyCode === 27) {
280	            $('#search-popup').removeClass('popup-visible');
281	        }
282	    });
283		//Hide Popup
284		$('.close-search,.search-popup .overlay-layer').on('click', function() {
285			$('#search-popup').removeClass('popup-visible');
286		});
287	}
288
289
290	//Add One Page nav
291	if($('.scroll-nav').length) {
292		$('.scroll-nav').onePageNav();
293	}
294
295	//Sortable Masonary with Filters
296	function enableMasonry() {
297		if($('.sortable-masonry').length){
298	
299			var winDow = $(window);
300			// Needed variables
301			var $container=$('.sortable-masonry .items-container');
302			var $filter=$('.filter-btns');
303	
304			$container.isotope({
305				filter:'*',
306				 masonry: {
307					columnWidth : '.masonry-item.small-column'
308				 },
309				animationOptions:{
310					duration:500,
311					easing:'linear'
312				}
313			});
314			
315	
316			// Isotope Filter 
317			$filter.find('li').on('click', function(){
318				var selector = $(this).attr('data-filter');
319	
320				try {
321					$container.isotope({ 
322						filter	: selector,
323						animationOptions: {
324							duration: 500,
325							easing	: 'linear',
326							queue	: false
327						}
328					});
329				} catch(err) {
330	
331				}
332				return false;
333			});
334	
335	
336			winDow.on('resize', function(){
337				var selector = $filter.find('li.active').attr('data-filter');
338
339				$container.isotope({ 
340					filter	: selector,
341					animationOptions: {
342						duration: 500,
343						easing	: 'linear',
344						queue	: false
345					}
346				});
347			});
348	
349	
350			var filterItemA	= $('.filter-btns li');
351	
352			filterItemA.on('click', function(){
353				var $this = $(this);
354				if ( !$this.hasClass('active')) {
355					filterItemA.removeClass('active');
356					$this.addClass('active');
357				}
358			});
359		}
360	}
361	
362	enableMasonry();
363
364
365	if($('.paroller').length){
366		$('.paroller').paroller({
367			  factor: 0.1,            // multiplier for scrolling speed and offset, +- values for direction control  
368			  factorLg: 0.1,          // multiplier for scrolling speed and offset if window width is less than 1200px, +- values for direction control  
369			  type: 'foreground',     // background, foreground  
370			  direction: 'vertical' // vertical, horizontal  
371		});
372	}
373
374	if($('.paroller-2').length){
375		$('.paroller-2').paroller({
376			  factor: -0.1,            // multiplier for scrolling speed and offset, +- values for direction control  
377			  factorLg: -0.1,          // multiplier for scrolling speed and offset if window width is less than 1200px, +- values for direction control  
378			  type: 'foreground',     // background, foreground  
379			  direction: 'vertical' // vertical, horizontal  
380		});
381	}
382
383
384    // Progress Bar
385	if ($('.count-bar').length) {
386		$('.count-bar').appear(function(){
387			var el = $(this);
388			var percent = el.data('percent');
389			$(el).css('width',percent).addClass('counted');
390		},{accY: -50});
391
392	}
393
394
395	$(document).ready(function() {
396      $('select:not(.ignore)').niceSelect();
397    });
398
399
400
401	/* ==========================================================================
402   When document is Scrollig, do
403   ========================================================================== */
404	
405	$(window).on('scroll', function() {
406		headerStyle();
407	});
408
409	
410	
411	/* ==========================================================================
412   When document is loaded, do
413   ========================================================================== */
414	
415	$(window).on('load', function() {
416		handlePreloader();
417		enableMasonry();
418	});
419
420	jQuery( ".bg_image" ).each(function() {
421		var attr = $(this).attr('data-image-src');
422		
423		if (typeof attr !== typeof undefined && attr !== false) {
424			$(this).css('background-image', 'url('+attr+')');
425		}
426		
427	});
428
429	
430
431})(window.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.