All the elements are correctly added to the DOM (see developer tools screenshot — all tags are inside the container).
However, when I slide to the next page using transform: translateX(), the elements are not visible, even though they are definitely in the DOM and have correct size (see the second Скриншот). < /p>
Что может вызвать эту проблему? (data-page = "0") отображается совершенно нормально. < /p>
Код: Выделить всё
const pages = [{
prefix: 'assets/emoji_',
count: 18
},
{
prefix: 'assets/effect_',
count: 18
}
];
function initializePages() {
const grids = document.querySelectorAll('.page-grid');
grids.forEach((grid, index) => {
const page = pages[index];
for (let i = 1; i
.page-slider {
display: flex;
width: 100%;
overflow: hidden;
transition: transform 0.4s ease;
}
.page-grid {
min-width: 100%;
display: grid;
grid-template-columns: repeat(3, 1fr);
}< /code>
Подробнее здесь: https://stackoverflow.com/questions/795 ... -transform
Мобильная версия