?
| Current Path : /home/webyoo/www/events/crm/builder-construction/js/ |
| Current File : /home/webyoo/www/events/crm/builder-construction/js/script.js |
// if ($(window).width() < 1020) {}
/* ===================================
Loading Timeout
====================================== */
$(window).on("load", function () {
"use strict";
/* ===================================
Loading Timeout
====================================== */
$('.side-menu').removeClass('hidden');
setTimeout(function(){
$('.preloader').fadeOut();
$('.cd-transition-layer').addClass('closing').delay(1000).queue(function(){
$(this).removeClass("visible closing opening").dequeue();
});
}, 1000);
setTimeout(function(){
$('.banner-slider .svg-div').removeClass('svg-anim');
}, 1000);
});
//*********************SMOOTH SCROLL*****************************//
$("a.pagescroll").on("click", function (event) {
event.preventDefault();
$("html,body").animate({
scrollTop: $(this.hash).offset().top
}, 1200);
});
/* ===================================
WOW Animation
====================================== */
if ($(window).width() > 991) {
var wow = new WOW({
boxClass: 'wow',
animateClass: 'animated',
offset: 0,
mobile: false,
live: true
});
new WOW().init();
}
/* ===================================
Scroll
====================================== */
jQuery(function ($) {
"use strict";
$(window).on('scroll', function () {
if ($(this).scrollTop() > 260) { // Set position from top to add class
$('header').addClass('header-appear');
} else {
$('header').removeClass('header-appear');
}
});
});
$(".scroll").on("click", function(event){
event.preventDefault();
$('html,body').animate({
scrollTop: $(this.hash).offset().top - 0}, 1100);
});
/* ===================================
Side Menu
====================================== */
if ($("#sidemenu_toggle").length) {
$("#sidemenu_toggle").on("click", function () {
$(".pushwrap").toggleClass("active");
$(".side-menu").addClass("side-menu-active"), $("#close_side_menu").fadeIn(700)
}), $("#close_side_menu").on("click", function () {
$(".side-menu").removeClass("side-menu-active"), $(this).fadeOut(200), $(".pushwrap").removeClass("active")
}), $(".side-nav .navbar-nav .nav-link").on("click", function () {
$(".side-menu").removeClass("side-menu-active"), $("#close_side_menu").fadeOut(200), $(".pushwrap").removeClass("active")
}), $("#btn_sideNavClose").on("click", function () {
$(".side-menu").removeClass("side-menu-active"), $("#close_side_menu").fadeOut(200), $(".pushwrap").removeClass("active")
});
}
/*=====================================
Reviews Carousel
======================================*/
$('.testimonial-box').owlCarousel({
loop: true,
margin: 20,
slideSpeed: 2000,
slideTransition: 'linear',
nav: false,
dots: false,
autoplay: true,
autoplayTimeout: 5000,
autoplayHoverPause: true,
responsive: {
0: {
items: 1
},
600: {
items: 1
},
1000: {
items: 1
},
}
});
$('.customNextBtn').click(function() {
var owl = $('.testimonial-box');
owl.owlCarousel();
owl.trigger('next.owl.carousel');
});
$('.customPrevBtn').click(function() {
var owl = $('.testimonial-box');
owl.owlCarousel();
owl.trigger('prev.owl.carousel', [300]);
});
/* ===================================
Cube Portfolio
====================================== */
$('#js-grid-mosaic').cubeportfolio({
filters: '#js-filters-mosaic',
layoutMode: 'grid',
sortByDimension: true,
mediaQueries: [{
width: 1500,
cols: 2,
}, {
width: 1100,
cols: 2,
}, {
width: 768,
cols: 1,
}, {
width: 480,
cols: 1,
options: {
gapHorizontal: 60
}
}],
defaultFilter: '*',
animationType: 'fadeIn',
gapHorizontal: 50,
gapVertical: 50,
gridAdjustment: 'responsive',
caption: 'zoom',
// lightbox
lightboxDelegate: '.cbp-lightbox',
lightboxGallery: true,
lightboxTitleSrc: 'data-title',
lightboxCounter: '<div class="cbp-popup-lightbox-counter">{{current}} of {{total}}</div>',
plugins: {
loadMore: {
element: "#js-loadMore-lightbox-gallery",
action: "click",
loadItems: 5,
}
}
})
.on('initComplete.cbp', function () {
// your functionality
var $this = $(this);
if ($(".cbp-filter-item-active").attr("data-filter") === "*") {
$("#js-loadMore-lightbox-gallery").addClass("active");
} else {
$("#js-loadMore-lightbox-gallery").removeClass("active");
}
$this.find(".cbp-wrapper").find(".cbp-item:not(.cbp-item-off)").each(function (index) {
$(this).removeClass("even");
console.log();
var val = index + 1;
if ($(this).css('left') !== "0px") {
$(this).addClass("even");
}
});
})
.on('onAfterLoadMore.cbp', function () {
// your functionality
var $this = $(this);
$("#js-loadMore-lightbox-gallery a").addClass("d-none");
$("#js-loadMore-lightbox-gallery").addClass("active-outer");
$this.find(".cbp-wrapper").find(".cbp-item:not(.cbp-item-off)").each(function (index) {
$(this).removeClass("even");
console.log();
var val = index + 1;
if ($(this).css('left') !== "0px") {
$(this).addClass("even");
}
});
})
.on('filterComplete.cbp', function () {
// your functionality
var $this = $(this);
if ($(".cbp-filter-item-active").attr("data-filter") === "*") {
$("#js-loadMore-lightbox-gallery").addClass("active");
$("#js-loadMore-lightbox-gallery").removeClass("d-none");
} else {
$("#js-loadMore-lightbox-gallery").removeClass("active");
$("#js-loadMore-lightbox-gallery").addClass("d-none");
}
$this.find(".cbp-wrapper").find(".cbp-item:not(.cbp-item-off)").each(function (index) {
$(this).removeClass("even");
var val = index + 1;
if ($(this).css('left') !== "0px") {
$(this).addClass("even");
}
});
});
/*===================================
Go Top Scroll
====================================== */
$(function(){
// Scroll Event
$(window).on('scroll', function(){
var scrolled = $(window).scrollTop();
if (scrolled > 600) $('.go-top').addClass('active');
if (scrolled < 600) $('.go-top').removeClass('active');
});
// Click Event
$('.go-top').on('click', function() {
$("html, body").animate({ scrollTop: "0" }, 500);
});
});
/*===================================
//Fancy Box
======================================*/
$('[data-fancybox]').fancybox({
'transitionIn': 'elastic',
'transitionOut': 'elastic',
'speedIn': 600,
'speedOut': 200,
buttons: [
'slideShow',
'fullScreen',
'thumbs',
'share',
// 'download',
'zoom',
'close'
],
});
/*===================================
Swiper Sync Slider
======================================*/
if ($("#gallery").length) {
var galleryTop = new Swiper('#gallery', {
effect: 'fade',
direction: 'vertical',
spaceBetween: 10,
slidesPerView: 1,
slidesPerGroup: 1,
loop: true,
initialSlide: 0,
centeredSlides: true,
loopAdditionalSlides: 5,
touchRatio: 0.2,
});
var galleryThumbs = new Swiper('#thumbs', {
direction: 'vertical',
spaceBetween: 10,
slidesPerView: 3,
slidesPerGroup: 1,
loop: true,
initialSlide: 0,
centeredSlides: true,
loopAdditionalSlides: 3,
touchRatio: 0.2,
slideToClickedSlide: true
});
galleryTop.controller.control = galleryThumbs;
galleryThumbs.controller.control = galleryTop;
}
/*===================================
LATEST ARRIVALS OWL CAROUSEL
======================================*/
$('.lastest_featured_products').owlCarousel({
loop: true,
margin: 10,
nav: false,
dots: true,
autoplay: true,
autoplayTimeout: 3000,
autoplayHoverPause: true,
responsive: {
0: {
items: 1
},
600: {
items: 2
},
1000: {
items: 4
}
}
});