Đặt chiều cao bằng nhau, Set equal height, same height (ok)

window.addEventListener('load', () => {
  setTimeout(() => {
    const carousels = document.querySelectorAll('.labb-carousel');
    carousels.forEach(carousel => {
      height = carousel.offsetHeight;
    });
    const slides = document.querySelectorAll('.slick-slide');
    slides.forEach(slide => {
      const img = slide.querySelector('.labb-carousel img');
      img.style.height = height + 'px';
      img.style.width = 'auto';
      img.style.objectFit = 'cover';
    });
  }, 1000); 
});

Last updated

Was this helpful?