(function ($){
$(document).ready(function (){
"use strict";
$(".tab-nav li").on('click', function (e){
$(".tab-item").hide();
$(".tab-nav li").removeClass('active');
$(this).addClass("active");
var selected_tab=$(this).find("a").attr("href");
$(selected_tab).stop().show();
return false;
});
$(".site-menu ul li").hover(function (){
$('.site-menu ul li').not(this).css({
"opacity": "1"
});
},
function (){
$('.site-menu ul li').not(this).css({
"opacity": "1"
});
});
$('.hamburger-menu').on('click', function (e){
$(this).toggleClass('open');
$(".side-widget").toggleClass('active');
$("body").toggleClass("overflow");
});
$('body a').on('click', function (e){
var target=$(this).attr('target');
var fancybox=$(this).data('fancybox');
var url=this.getAttribute("href");
if(target!='_blank'&&typeof fancybox=='undefined'&&url.indexOf('') < 0){
e.preventDefault();
var url=this.getAttribute("href");
if(url.indexOf('')!=-1){
var hash=url.substring(url.indexOf('#'));
if($('body ' + hash).length!=0){
$('.page-transition').removeClass("active");
}}else{
$('.page-transition').toggleClass("active");
setTimeout(function (){
window.location=url;
}, 1000);
}}
});
});
var pageSection=$("*");
pageSection.each(function (indx){
if($(this).attr("data-background")){
$(this).css("background", "url(" + $(this).data("background") + ")");
}});
var pageSection=$("*");
pageSection.each(function (indx){
if($(this).attr("data-background")){
$(this).css("background", $(this).data("background"));
}});
wow=new WOW({
animateClass: 'animated',
offset: 0
});
wow.init();
var swiper=new Swiper('.carousel-classes', {
slidesPerView: '1',
spaceBetween: 30,
loop: 'true',
draggable: 'true',
navigation: {
prevEl: '.button-prev1',
nextEl: '.button-next1',
},
pagination: {
el: '.swiper-pagination',
clickable: true,
},
breakpoints: {
640: {
slidesPerView: 1,
spaceBetween: 15,
},
768: {
slidesPerView: 2,
spaceBetween: 30,
},
1024: {
slidesPerView: 3,
spaceBetween: 30,
},
}});
var swiper=new Swiper('.main-slider', {
slidesPerView: '1',
spaceBetween: 0,
speed: 1000,
effect: 'fade',
fadeEffect: {
crossFade: true
},
loop: true,
draggable: 'true',
autoplay: {
delay: 15000,
disableOnInteraction: false,
},
navigation: {
prevEl: '.button-prev',
nextEl: '.button-next',
},
pagination: {
el: '.swiper-pagination',
clickable: true,
},
});
$(document).scroll(function (){
$('.odometer').each(function (){
var parent_section_postion=$(this).closest('section').position();
var parent_section_top=parent_section_postion.top;
if($(document).scrollTop() > parent_section_top - 300){
if($(this).data('status')=='yes'){
$(this).html($(this).data('count'));
$(this).data('status', 'no');
}}
});
});
$(window).load(function (){
$("body").addClass("page-loaded");
});
})(jQuery);
let question=document.querySelectorAll(".question");
question.forEach(question=> {
question.addEventListener("click", event=> {
const active=document.querySelector(".question.active");
if(active&&active!==question){
active.classList.toggle("active");
active.nextElementSibling.style.maxHeight=0;
}
question.classList.toggle("active");
const answer=question.nextElementSibling;
if(question.classList.contains("active")){
answer.style.maxHeight=answer.scrollHeight + "px";
}else{
answer.style.maxHeight=0;
}})
});