Đặ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);
});
PreviousLấy vị trí người dùng với javascriptNext[Problem] Lấy key đầu tiên tìm thấy chứa giá trị cần tìm (ok)
Last updated
Was this helpful?