'); elem.append(''); // Insertar inner items.wrapAll('
'); // Insertar outer elem.find("#inner").wrap('
'); var outer = $("#outer"); // Mostrar/ocultar botones de scroll const container = document.getElementById("outer"); const lBtn = document.getElementById("left-button"); const rBtn = document.getElementById("right-button"); container.addEventListener("scroll", () => { if (container.scrollLeft > 0) { lBtn.style.opacity = ".25"; rBtn.style.opacity = "1"; } else { lBtn.style.opacity = "1"; rBtn.style.opacity = "0"; } }); var updateUI = function () { var maxWidth = outer.outerWidth(true); var actualWidth = 0; $.each($("#inner >"), function (i, item) { actualWidth += $(item).outerWidth(true); }); if (actualWidth