const sliderTienda1 = document.querySelector(“#slider-tienda-1”);
let sliderSectionTienda1 = document.querySelectorAll(“.slider-section-tienda-1”);
let sliderSectionLastTienda1 = sliderSectionTienda1[sliderSectionTienda1.length – 1];
const btnLeftTienda1 = document.querySelector(“#btn-left-tienda-1”);
const btnRightTienda1 = document.querySelector(“#btn-right-tienda-1”);
sliderTienda1.insertAdjacentElement(“afterbegin”, sliderSectionLastTienda1);
function NextTienda1() {
let sliderSectionFirstTienda1 = document.querySelectorAll(“.slider-section-tienda-1”)[0];
sliderTienda1.style.marginLeft = “-200%”;
sliderTienda1.style.transition = “all 0.8s”;
setTimeout(function () {
sliderTienda1.style.transition = “none”;
sliderTienda1.insertAdjacentElement(“beforeend”, sliderSectionFirstTienda1);
sliderTienda1.style.marginLeft = “-100%”;
}, 800);
}
function PrevTienda1() {
let sliderSectionTienda1 = document.querySelectorAll(“.slider-section-tienda-1”);
let sliderSectionLastTienda1 = sliderSectionTienda1[sliderSectionTienda1.length – 1];
sliderTienda1.style.marginLeft = “0”;
sliderTienda1.style.transition = “all 0.8s”;
setTimeout(function () {
sliderTienda1.style.transition = “none”;
sliderTienda1.insertAdjacentElement(“afterbegin”, sliderSectionLastTienda1);
sliderTienda1.style.marginLeft = “-100%”;
}, 800);
}
btnRightTienda1.addEventListener(“click”, function () {
NextTienda1();
});
btnLeftTienda1.addEventListener(“click”, function () {
PrevTienda1();
});