Некодим© 2020-2026 Некодим
Готовые модификации для вашего сайта. Улучшайте функциональность и дизайн без программирования.
Журнал изменений История Git Файлы Tilda MCP Каталог файловtilda-zoom-2.0.js Следить за файлом 101 t_zoom__setEvents();102 }103 104 /**105 * Если используется lazyload в проекте - добавляем прелоадер к зум-галерее.106 *107 * @param {HTMLElement} element - родительский элемент, к которому добавляется лоадер.108 */109 function t_zoom__appendPreloaderToElement(element) {110 const { hasLazy } = t_getZoomState();111 if (!element || !hasLazy) return;112 История файла и сравнение версий const loader = document.createElement('div');
114 loader.classList.add('t-zoomer-loader');115 loader.innerHTML = t_zoom__getIconHTML('loader');116 element.append(loader);120 * create close btn for zoomer wrapper122 * @return {HTMLDivElement} - close btn124 function t_zoom__createCloseBtn() {125 const zoomCloseBtn = document.createElement('div');126 zoomCloseBtn.classList.add('t-zoomer__close', 't-zoomer__ui-item');127 zoomCloseBtn.insertAdjacentHTML('beforeend', t_zoom__getIconHTML('close'));132 * create scale btn for zoomer wrapper134 * @return {HTMLDivElement} - scale btn136 function t_zoom__createScaleBtn() {137 const scaleBtn = document.createElement('div');138 scaleBtn.classList.add('t-zoomer__scale', 't-zoomer__ui-item');139 scaleBtn.insertAdjacentHTML('beforeend', t_zoom__getIconHTML('icon-increase'));140 scaleBtn.insertAdjacentHTML('beforeend', t_zoom__getIconHTML('icon-decrease'));146 * @param {'icon-increase' | 'icon-decrease' | 'close' | 'loader' | 'arrow-left' | 'arrow-right'} icon149 function t_zoom__getIconHTML(icon) {150 if (icon === 'icon-increase') {152 class="icon-increase"157 xmlns="http://www.w3.org/2000/svg"163 d="M7.3878 4.77866C7.38786 4.44735 7.65586 4.17929 7.98718 4.17927C8.31852 4.17927 8.58651 4.44734 8.58657 4.77866L8.58588 7.32742H11.1353C11.4665 7.32742 11.7358 7.59571 11.7361 7.9268C11.7361 8.25801 11.4672 8.52661 11.136 8.52688H8.58657L8.58726 11.0756C8.58726 11.407 8.31855 11.6757 7.98718 11.6757C7.65582 11.6757 7.38711 11.407 7.38711 11.0756L7.38642 8.52688L4.83835 8.52688C4.50715 8.52672 4.23902 8.25872 4.23896 7.92749C4.23896 7.59622 4.50711 7.32827 4.83835 7.32811L7.38711 7.32742L7.3878 4.77866Z"167 d="M12.9865 12.9866C10.1529 15.8202 5.55872 15.8202 2.72512 12.9866C-0.108484 10.153 -0.108484 5.55879 2.72512 2.72519C5.55872 -0.108416 10.1529 -0.108415 12.9865 2.72519C15.8201 5.55879 15.8201 10.153 12.9865 12.9866ZM12.9865 12.9866L16.308 16.3081"169 stroke-linecap="round"173 if (icon === 'icon-decrease') {175 class="icon-decrease"180 xmlns="http://www.w3.org/2000/svg"186 d="M4.23883 7.92757C4.23883 7.5963 4.50698 7.32835 4.83822 7.32819L11.1352 7.3275C11.4664 7.3275 11.7356 7.59579 11.736 7.92688C11.736 8.25809 11.467 8.52669 11.1359 8.52696L4.83822 8.52696C4.50702 8.5268 4.23889 8.2588 4.23883 7.92757Z"190 d="M12.9865 12.9866C10.1529 15.8202 5.55872 15.8202 2.72512 12.9866C-0.108484 10.153 -0.108484 5.55882 2.72512 2.72522C5.55872 -0.108386 10.1529 -0.108385 12.9865 2.72522C15.8201 5.55882 15.8201 10.153 12.9865 12.9866ZM12.9865 12.9866L16.308 16.3081"192 stroke-linecap="round"196 if (icon === 'close') {198 <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">