$(window).load(function() { $(".sezione img").click(function() { $(".lightbox").fadeIn(300); $(".lightbox").append("" + $(this).attr("alt") + ""); $(".filter").css("background-image", "url(" + $(this).attr("src") + ")"); /*$(".title").append("

" + $(this).attr("alt") + "

");*/ $("html").css("overflow", "hidden"); if ($(this).is(":last-child")) { $(".arrowr").css("display", "none"); $(".arrowl").css("display", "block"); } else if ($(this).is(":first-child")) { $(".arrowr").css("display", "block"); $(".arrowl").css("display", "none"); } else { $(".arrowr").css("display", "block"); $(".arrowl").css("display", "block"); } }); $(".close").click(function() { $(".lightbox").fadeOut(300); $(".lightbox img").remove(); $("html").css("overflow", "auto"); }); $(document).keyup(function(e) { if (e.keyCode == 27) { $(".lightbox").fadeOut(300); $(".lightbox img").remove(); $("html").css("overflow", "auto"); } }); $(".arrowr").click(function() { var imgSrc = $(".lightbox img").attr("src"); var search = $(".sezione").find("img[src$='" + imgSrc + "']"); var newImage = search.next().attr("src"); /*$(".lightbox img").attr("src", search.next());*/ $(".lightbox img").attr("src", newImage); $(".filter").css("background-image", "url(" + newImage + ")"); if (!search.next().is(":last-child")) { $(".arrowl").css("display", "block"); } else { $(".arrowr").css("display", "none"); } }); $(".arrowl").click(function() { var imgSrc = $(".lightbox img").attr("src"); var search = $(".sezione").find("img[src$='" + imgSrc + "']"); var newImage = search.prev().attr("src"); /*$(".lightbox img").attr("src", search.next());*/ $(".lightbox img").attr("src", newImage); $(".filter").css("background-image", "url(" + newImage + ")"); if (!search.prev().is(":first-child")) { $(".arrowr").css("display", "block"); } else { $(".arrowl").css("display", "none"); } }); }); $(document).ready(function(){ $('.customer-logos').slick({ slidesToShow: 6, slidesToScroll: 1, autoplay: true, autoplaySpeed: 1500, arrows: false, dots: false, pauseOnHover: false, responsive: [{ breakpoint: 768, settings: { slidesToShow: 4 } }, { breakpoint: 520, settings: { slidesToShow: 3 } }] }); }); $('.multi-slider').slick({ dots: true, infinite: true, speed: 300, slidesToShow: 3, slidesToScroll: 3, variableWidth: true, responsive: [ { breakpoint: 1024, settings: { slidesToShow: 3, slidesToScroll: 3, infinite: true, dots: true } }, { breakpoint: 600, settings: { slidesToShow: 2, slidesToScroll: 2 } }, { breakpoint: 480, settings: { slidesToShow: 1, slidesToScroll: 1 } } // You can unslick at a given breakpoint now by adding: // settings: "unslick" // instead of a settings object ] });