if (jQuery(window).width() < 960) { jQuery('.gallery').owlCarousel({ margin:10, loop:false, autoWidth:false, items:4, autoplay: true, autoplayTimeout:3000, autoplayHoverPause:true, nav: false, dots: false, responsive:{ 0:{ items:2, }, 600:{ items:3, }, 1000:{ items:5, } } }) jQuery('.social').owlCarousel({ margin:10, loop:false, autoWidth:false, items:4, autoplay: false, nav: false, dots: false, responsive:{ 0:{ items:3, }, 600:{ items:3, }, 1000:{ items:5, } } }) } else { jQuery('.gallery').owlCarousel({ margin:10, loop:true, autoWidth:false, items:3, autoplay: true, autoplayTimeout:3000, autoplayHoverPause:true, nav: false, dots: false, }) jQuery('.social').owlCarousel({ margin:10, loop:true, autoWidth:true, items:4, autoplay: false, nav: false, dots: false, }) } jQuery('.logo_carousel').owlCarousel({ margin:60, loop:false, autoWidth:true, items:4, autoplay: false, nav: false, dots: false, }) jQuery('.photos').owlCarousel({ autoWidth:false, dots: false, margin: 15, nav: false, autoplay: true, autoplayTimeout: 2000, autoplaySpeed: 1000, navText: ["", ""], responsive: { 0: { items: 1 }, 600: { items: 2 }, 1000: { items: 3 } } }) let lastBackground = ''; function changeBackground(element, background) { var splitElement = document.getElementById("split"); var backgroundImage = `url('${background}')`; console.log(lastBackground); console.log(element); if (lastBackground === backgroundImage) { return; } var newBackgroundElement = document.createElement("div"); newBackgroundElement.classList.add("background-transition"); newBackgroundElement.style.backgroundImage = backgroundImage; var slideDirectionClass = ""; var lastBackgroundElement = splitElement.querySelector(".background-transition"); if (lastBackgroundElement) { slideDirectionClass = (lastBackgroundElement.offsetLeft < element.offsetLeft) ? "slide-from-right" : "slide-from-left"; } if (slideDirectionClass) { newBackgroundElement.classList.add(slideDirectionClass); } splitElement.appendChild(newBackgroundElement); splitElement.offsetHeight; newBackgroundElement.classList.add("slide-active"); setTimeout(function() { if (lastBackgroundElement) { lastBackgroundElement.remove(); } }, 500); lastBackground = backgroundImage; } var loader = document.getElementById("preloader"); window.addEventListener("load", function(){ loader.style.opacity = "0"; setTimeout( function() { if(loader.style.opacity = "0"){ loader.style.display = "none"; } }, 500); });