PageSourceSearch

https://mcph.in/js/script.js

js mcph.in collected 2026-10-01 07:29:46 UTC 13,155 bytes, 620 lines download raw bytes

1(function($) {
2	
3	"use strict";
4	
5	
6	//Hide Loading Box (Preloader)
7	function handlePreloader() {
8		if($('.preloader').length){
9			$('.preloader').delay(200).fadeOut(500);
10		}
11	}
12	
13	
14	//Update Header Style and Scroll to Top
15	function headerStyle() {
16		if($('.main-header').length){
17			var windowpos = $(window).scrollTop();
18			var siteHeader = $('.main-header');
19			var siteHeaderHeight = $('.main-header').height();
20			var scrollLink = $('.scroll-to-top');
21			if (windowpos >= siteHeaderHeight) {
22				siteHeader.addClass('fixed-header');
23				scrollLink.fadeIn(300);
24			} else {
25				siteHeader.removeClass('fixed-header');
26				scrollLink.fadeOut(300);
27			}
28		}
29	}
30	
31	headerStyle();
32	
33	
34	//Maintenance Section Height
35	function maintenanceSection() {
36		if($('.maintenance-section').length){
37			var windowHeight = $(window).height();
38			var siteHeader = $('.main-header').height();
39			var finalHeight = windowHeight - siteHeader;
40			$('.maintenance-section').css('min-height',finalHeight);
41		}
42	}
43	
44	maintenanceSection();
45	
46	
47	//Submenu Dropdown Toggle
48	if($('.main-header .main-menu li.dropdown ul').length){
49		$('.main-header .main-menu li.dropdown').append('<div class="dropdown-btn"><span class="fa fa-angle-down"></span></div>');
50		
51		//Dropdown Button
52		$('.main-header .main-menu li.dropdown .dropdown-btn').on('click', function() {
53			$(this).prev('ul').slideToggle(500);
54		});
55		
56		//Megamenu Toggle
57		$('.main-header .main-menu li.dropdown .dropdown-btn').on('click', function() {
58			$(this).prev('.mega-menu').slideToggle(500);
59		});
60		
61		//Disable dropdown parent link
62		$('.main-header .main-menu .navigation li.dropdown > a,.hidden-bar .side-menu li.dropdown > a').on('click', function(e) {
63			e.preventDefault();
64		});
65	}
66	
67	
68	
69	//Tabs Box
70	if($('.tabs-box').length){
71		$('.tabs-box .tab-buttons .tab-btn').on('click', function(e) {
72			e.preventDefault();
73			var target = $($(this).attr('data-tab'));
74			
75			if ($(target).is(':visible')){
76				return false;
77			}else{
78				target.parents('.tabs-box').find('.tab-buttons').find('.tab-btn').removeClass('active-btn');
79				$(this).addClass('active-btn');
80				target.parents('.tabs-box').find('.tabs-content').find('.tab').fadeOut(0);
81				target.parents('.tabs-box').find('.tabs-content').find('.tab').removeClass('active-tab');
82				$(target).fadeIn(300);
83				$(target).addClass('active-tab');
84			}
85		});
86	}
87	
88	
89	
90	//Masonary
91	function enableMasonry() {
92		if($('.masonry-items-container').length){
93	
94			var winDow = $(window);
95			// Needed variables
96			var $container=$('.masonry-items-container');
97	
98			$container.isotope({
99				itemSelector: '.masonry-item',
100				 masonry: {
101					columnWidth : '.masonry-item.col-md-4'
102				 },
103				animationOptions:{
104					duration:500,
105					easing:'linear'
106				}
107			});
108	
109			winDow.bind('resize', function(){
110
111				$container.isotope({ 
112					itemSelector: '.masonry-item',
113					animationOptions: {
114						duration: 500,
115						easing	: 'linear',
116						queue	: false
117					}
118				});
119			});
120		}
121	}
122	
123	enableMasonry();
124	
125	
126	//Price Range Slider
127	if($('.price-range-slider').length){
128		$( ".price-range-slider" ).slider({
129			range: true,
130			min: 0,
131			max: 90,
132			values: [ 8, 85 ],
133			slide: function( event, ui ) {
134			$( "input.property-amount" ).val( ui.values[ 0 ] + " - " + ui.values[ 1 ] );
135			}
136		});
137		
138		$( "input.property-amount" ).val( $( ".price-range-slider" ).slider( "values", 0 ) + " - $" + $( ".price-range-slider" ).slider( "values", 1 ) );	
139	}
140	
141	
142	//Jquery Spinner / Quantity Spinner
143	if($('.quantity-spinner').length){
144		$("input.quantity-spinner").TouchSpin({
145		  verticalbuttons: true
146		});
147	}
148	
149	
150	//Fact Counter + Text Count
151	if($('.count-box').length){
152		$('.count-box').appear(function(){
153	
154			var $t = $(this),
155				n = $t.find(".count-text").attr("data-stop"),
156				r = parseInt($t.find(".count-text").attr("data-speed"), 10);
157				
158			if (!$t.hasClass("counted")) {
159				$t.addClass("counted");
160				$({
161					countNum: $t.find(".count-text").text()
162				}).animate({
163					countNum: n
164				}, {
165					duration: r,
166					easing: "linear",
167					step: function() {
168						$t.find(".count-text").text(Math.floor(this.countNum));
169					},
170					complete: function() {
171						$t.find(".count-text").text(this.countNum);
172					}
173				});
174			}
175			
176		},{accY: 0});
177	}
178	
179	
180	//Single Item Carousel
181	if ($('.single-item-carousel').length) {
182		$('.single-item-carousel').owlCarousel({
183			loop:false,
184			margin:30,
185			nav:true,
186			dots:false,
187			smartSpeed: 700,
188			autoplay: 5000,
189			navText: [ '<span class="fa fa-angle-left"></span>', '<span class="fa fa-angle-right"></span>' ],
190			responsive:{
191				0:{
192					items:1
193				},
194				600:{
195					items:1
196				},
197				780:{
198					items:1
199				},
200				800:{
201					items:1
202				},
203				1024:{
204					items:1
205				},
206				1200:{
207					items:1
208				}
209			}
210		});    		
211	}
212	
213	
214	    $(window).load(function(){
215        setTimeout(function() {
216                $('#enquirypopup').modal('show');
217        }, 2000);
218            });
219	
220	//Testimonial Item Carousel
221	if ($('.testimonial-item-carousel').length) {
222		$('.testimonial-item-carousel').owlCarousel({
223			loop:false,
224			margin:30,
225			nav:true,
226			dots:false,
227			smartSpeed: 700,
228			autoplay: 5000,
229			navText: [ '<span class="fa fa-angle-left"></span>', '<span class="fa fa-angle-right"></span>' ],
230			responsive:{
231				0:{
232					items:1
233				},
234				600:{
235					items:1
236				},
237				780:{
238					items:1
239				},
240				800:{
241					items:1
242				},
243				1024:{
244					items:1
245				},
246				1200:{
247					items:1
248				}
249			}
250		});    		
251	}
252	
253	
254	//Three Item Carousel
255	if ($('.three-item-carousel').length) {
256		$('.three-item-carousel').owlCarousel({
257			loop:false,
258			margin:30,
259			nav:true,
260			smartSpeed: 700,
261			autoplay: 5000,
262			navText: [ '<span class="fa fa-angle-left"></span>', '<span class="fa fa-angle-right"></span>' ],
263			responsive:{
264				0:{
265					items:1
266				},
267				600:{
268					items:1
269				},
270				780:{
271					items:2
272				},
273				800:{
274					items:2
275				},
276				1024:{
277					items:3
278				},
279				1200:{
280					items:3
281				}
282			}
283		});    		
284	}
285	
286	
287	//Custom Seclect Box
288	if($('.custom-select-box').length){
289		$('.custom-select-box').selectmenu().selectmenu('menuWidget').addClass('overflow');
290	}
291	
292	
293	//Progress Bar / Levels
294	if($('.progress-levels .progress-box .bar-fill').length){
295		$(".progress-box .bar-fill").each(function() {
296			$('.progress-box .bar-fill').appear(function(){
297				var progressWidth = $(this).attr('data-percent');
298				$(this).css('height',progressWidth+'%');
299			});
300			
301		},{accY: 0});
302	}
303	
304	
305	
306	
307	
308	// Product Carousel Slider
309	if ($('.history-carousel .content-carousel').length && $('.history-carousel .thumbs-carousel').length) {
310
311		var $sync3 = $(".history-carousel .content-carousel"),
312			$sync4 = $(".history-carousel .thumbs-carousel"),
313			flags = false,
314			durations = 500;
315
316			$sync3
317				.owlCarousel({
318					loop:false,
319					items: 1,
320					margin: 0,
321					nav: true,
322					navText: [ '<span class="icon flaticon-left-arrow-1"></span>', '<span class="icon flaticon-right-arrow-1"></span>' ],
323					dots: false,
324					autoplay: true,
325					autoplayTimeout: 5000
326				})
327				.on('changed.owl.carousel', function (e) {
328					if (!flags) {
329						flags = false;
330						$sync4.trigger('to.owl.carousel', [e.item.index, durations, true]);
331						flags = false;
332					}
333				});
334
335			$sync4
336				.owlCarousel({
337					loop:false,
338					margin: 0,
339					items: 1,
340					nav: true,
341					navText: [ '<span class="icon flaticon-left-arrow-1"></span>', '<span class="icon flaticon-right-arrow-1"></span>' ],
342					dots: false,
343					center: false,
344					autoplay: true,
345					autoplayTimeout: 5000,
346					responsive: {
347						0:{
348				            items:1,
349				            autoWidth: false
350				        },
351				        400:{
352				            items:1,
353				            autoWidth: false
354				        },
355				        600:{
356				            items:1,
357				            autoWidth: false
358				        },
359				        900:{
360				            items:1,
361				            autoWidth: false
362				        },
363				        1000:{
364				            items:1,
365				            autoWidth: false
366				        }
367				    },
368				})
369				
370		.on('click', '.owl-item', function () {
371			$sync3.trigger('to.owl.carousel', [$(this).index(), durations, true]);
372		})
373		.on('changed.owl.carousel', function (e) {
374			if (!flags) {
375				flags = true;		
376				$sync3.trigger('to.owl.carousel', [e.item.index, durations, true]);
377				flags = false;
378			}
379		});
380
381	}
382	
383	//Accordion Box
384	if($('.accordion-box').length){
385		$(".accordion-box").on('click', '.acc-btn', function() {
386			
387			var outerBox = $(this).parents('.accordion-box');
388			var target = $(this).parents('.accordion');
389			
390			if($(this).hasClass('active')!==true){
391				$(outerBox).find('.accordion .acc-btn').removeClass('active');
392			}
393			
394			if ($(this).next('.acc-content').is(':visible')){
395				return false;
396			}else{
397				$(this).addClass('active');
398				$(outerBox).children('.accordion').removeClass('active-block');
399				$(outerBox).find('.accordion').children('.acc-content').slideUp(300);
400				target.addClass('active-block');
401				$(this).next('.acc-content').slideDown(300);	
402			}
403		});	
404	}
405	
406	
407	//Two Item Carousel
408	if ($('.two-item-carousel').length) {
409		$('.two-item-carousel').owlCarousel({
410			loop:true,
411			margin:70,
412			nav:true,
413			smartSpeed: 500,
414			autoplay: 5000,
415			navText: [ '<span class="flaticon-left-arrow-1"></span>', '<span class="flaticon-right-arrow-1"></span>' ],
416			responsive:{
417				0:{
418					items:1
419				},
420				600:{
421					items:1
422				},
423				800:{
424					items:2
425				},
426				1024:{
427					items:2
428				},
429				1200:{
430					items:2
431				}
432			}
433		});    		
434	}
435	
436	//Two Item Testimonial
437	if ($('.testimonial-two-item').length) {
438		$('.testimonial-two-item').owlCarousel({
439			loop:true,
440			margin:30,
441			nav:true,
442			dots:false,
443			smartSpeed: 500,
444			autoplay: 5000,
445			navText: [ '<span class="flaticon-left-arrow-1"></span>', '<span class="flaticon-right-arrow-1"></span>' ],
446			responsive:{
447				0:{
448					items:1
449				},
450				600:{
451					items:1
452				},
453				800:{
454					items:1
455				},
456				1024:{
457					items:1
458				},
459				1200:{
460					items:1
461				}
462			}
463		});    		
464	}
465	
466	
467	// Sponsors Carousel
468	if ($('.sponsors-carousel').length) {
469		$('.sponsors-carousel').owlCarousel({
470			loop:true,
471			margin:0,
472			nav:true,
473			smartSpeed: 500,
474			autoplay: 4000,
475			navText: [ '<span class="fa fa-angle-left"></span>', '<span class="fa fa-angle-right"></span>' ],
476			responsive:{
477				0:{
478					items:1
479				},
480				480:{
481					items:2
482				},
483				600:{
484					items:4
485				},
486				800:{
487					items:5
488				},
489				1024:{
490					items:6
491				}
492			}
493		});    		
494	}
495	
496	
497	// Sponsors Carousel Two
498	if ($('.sponsors-carousel-two').length) {
499		$('.sponsors-carousel-two').owlCarousel({
500			loop:true,
501			margin:20,
502			nav:true,
503			smartSpeed: 500,
504			autoplay: 4000,
505			navText: [ '<span class="fa fa-angle-left"></span>', '<span class="fa fa-angle-right"></span>' ],
506			responsive:{
507				0:{
508					items:1
509				},
510				480:{
511					items:2
512				},
513				600:{
514					items:4
515				},
516				800:{
517					items:5
518				},
519				1024:{
520					items:5
521				}
522			}
523		});    		
524	}
525
526	
527	//LightBox / Fancybox
528	if($('.lightbox-image').length) {
529		$('.lightbox-image').fancybox({
530			openEffect  : 'fade',
531			closeEffect : 'fade',
532			helpers : {
533				media : {}
534			}
535		});
536	}
537	
538	
539	//Contact Form Validation
540	if($('#contact-form').length){
541		$('#contact-form').validate({
542			rules: {
543				username: {
544					required: true
545				},
546				email: {
547					required: true,
548					email: true
549				},
550				subject: {
551					required: true
552				},
553				message: {
554					required: true
555				}
556			}
557		});
558	}
559	
560	
561	//Gallery Filters
562	if($('.filter-list').length){
563		$('.filter-list').mixItUp({});
564	}
565	
566	
567	// Scroll to a Specific Div
568	if($('.scroll-to-target').length){
569		$(".scroll-to-target").on('click', function() {
570			var target = $(this).attr('data-target');
571		   // animate
572		   $('html, body').animate({
573			   scrollTop: $(target).offset().top
574			 }, 1500);
575	
576		});
577	}
578	
579	
580	// Elements Animation
581	if($('.wow').length){
582		var wow = new WOW(
583		  {
584			boxClass:     'wow',      // animated element css class (default is wow)
585			animateClass: 'animated', // animation css class (default is animated)
586			offset:       0,          // distance to the element when triggering the animation (default is 0)
587			mobile:       false,       // trigger animations on mobile devices (default is true)
588			live:         true       // act on asynchronously loaded content (default is true)
589		  }
590		);
591		wow.init();
592	}
593
594
595/* ==========================================================================
596   When document is Scrollig, do
597   ========================================================================== */
598	
599	$(window).on('scroll', function() {
600		headerStyle();
601	});
602	
603/* ==========================================================================
604   When document is loading, do
605   ========================================================================== */
606	
607	$(window).on('load', function() {
608		handlePreloader();
609		enableMasonry();
610	});
611
612/* ==========================================================================
613   When document is Resizing, do
614   ========================================================================== */
615	
616	$(window).on('resize', function() {
617		maintenanceSection();
618	});
619
620})(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.