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

<figure><img src="https://2494213435-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LYjAG13rAPdbArSfRyB%2Fuploads%2FSRlZ7LwgBTx51kFZhhYh%2Fimage.png?alt=media&#x26;token=6e97c133-edb7-454f-af1e-ffc3ed92a5f9" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2494213435-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LYjAG13rAPdbArSfRyB%2Fuploads%2FH3uQlJs9RR5efs8a5zoa%2Fimage.png?alt=media&#x26;token=7c09e281-c3ed-4846-a4c4-139f3f349e25" alt=""><figcaption></figcaption></figure>

```javascript
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); 
});
```
