Галерея Александра Шадрина
Выставки
Авторы
Новости
Контакты
Мастер-классы
En
Ru
Белый танец. Продана. Возможен авторский повтор
2016г., холст, масло, 70х90, цена 5000$
document.addEventListener('DOMContentLoaded', function() { // 1. Находим конкретный блок по ID const targetBlock = document.getElementById('rec758250685'); if (!targetBlock) { console.error('Блок #rec758250685 не найден'); return; } // 2. Находим элементы внутри блока const sliderWrapper = targetBlock.querySelector('.t-slds__items-wrapper'); const titleElement = targetBlock.querySelector('.t764__title'); const descrElement = targetBlock.querySelector('.t764__descr'); if (!sliderWrapper !titleElement !descrElement) { console.error('Не найдены необходимые элементы внутри блока'); return; } // 3. Функция обновления текста function updateSlideText() { const activeSlide = targetBlock.querySelector('.t-slds__item_active'); if (activeSlide) { const imgWrapper = activeSlide.querySelector('.t-slds__imgwrapper'); if (imgWrapper) { titleElement.textContent = imgWrapper.getAttribute('title') || ''; descrElement.textContent = imgWrapper.getAttribute('data-img-zoom-descr') || ''; } } } // 4. Вариант 1: MutationObserver const observer = new MutationObserver(function(mutations) { mutations.forEach(function(mutation) { if (mutation.attributeName === 'class') { updateSlideText(); } }); }); observer.observe(sliderWrapper, { attributes: true, subtree: true }); // 5. Вариант 2: Дополнительные обработчики для надежности targetBlock.addEventListener('click', function() { setTimeout(updateSlideText, 300); }); // Инициализация при загрузке updateSlideText(); });
document.addEventListener('DOMContentLoaded', function() { // 1. Находим конкретный блок по ID const targetBlock = document.getElementById('rec758250685'); if (!targetBlock) { console.error('Блок #rec758250685 не найден'); return; } // 2. Находим элементы внутри блока const sliderWrapper = targetBlock.querySelector('.t-slds__items-wrapper'); const titleElement = targetBlock.querySelector('.t764__title'); const descrElement = targetBlock.querySelector('.t764__descr'); if (!sliderWrapper !titleElement !descrElement) { console.error('Не найдены необходимые элементы внутри блока'); return; } // 3. Функция обновления текста function updateSlideText() { const activeSlide = targetBlock.querySelector('.t-slds__item_active'); if (activeSlide) { const imgWrapper = activeSlide.querySelector('.t-slds__imgwrapper'); if (imgWrapper) { titleElement.textContent = imgWrapper.getAttribute('title') || ''; descrElement.textContent = imgWrapper.getAttribute('data-img-zoom-descr') || ''; } } } // 4. Вариант 1: MutationObserver const observer = new MutationObserver(function(mutations) { mutations.forEach(function(mutation) { if (mutation.attributeName === 'class') { updateSlideText(); } }); }); observer.observe(sliderWrapper, { attributes: true, subtree: true }); // 5. Вариант 2: Дополнительные обработчики для надежности targetBlock.addEventListener('click', function() { setTimeout(updateSlideText, 300); }); // Инициализация при загрузке updateSlideText(); });
Живопись
Подробнее
Графика
Подробнее