Открыть блок в попапе

Как добавить блоки в попап
Пример работы скрипта
Book design is the art of incorporating the content, style, format, design, and sequence of the various components of a book into a coherent whole. In the words of Jan Tschichold, "methods and rules upon which it is impossible to improve, have been developed over centuries. To produce perfect books, these rules have to be brought back to life and applied."
Front matter, or preliminaries, is the first section of a book and is usually the smallest section in terms of the number of pages. Each page is counted, but no folio or page number is expressed or printed, on either display pages or blank pages.
Book design is the art of incorporating the content, style, format, design, and sequence of the various components of a book into a coherent whole. In the words of Jan Tschichold, "methods and rules upon which it is impossible to improve, have been developed over centuries. To produce perfect books, these rules have to be brought back to life and applied."
Front matter, or preliminaries, is the first section of a book and is usually the smallest section in terms of the number of pages. Each page is counted, but no folio or page number is expressed or printed, on either display pages or blank pages.
Book design is the art of incorporating the content, style, format, design, and sequence of the various components of a book into a coherent whole. In the words of Jan Tschichold, "methods and rules upon which it is impossible to improve, have been developed over centuries. To produce perfect books, these rules have to be brought back to life and applied."
Front matter, or preliminaries, is the first section of a book and is usually the smallest section in terms of the number of pages. Each page is counted, but no folio or page number is expressed or printed, on either display pages or blank pages.
#rec409535626,.uc-docs
#rec409542612,.uc-scripts
Инструкция
1
Добавьте на страницу попап с контентом
Скрипт работает с блоком BF503
2
Установите скрипт на страницу в HTML-блок
Скрипт должен быть установлен ниже блока попапа, в самом конце страницы, или в подвале
3
Добавьте ID блоков в контент попапа
Вы можете добавлять по несколько блоков в каждую карточку, перечисляя их через запятую. Посмотреть как.
4
Опубликуйте страницу
Наслаждайтесь результатом!
Скрипт
<script>
    fillPopup('#rec1234567'); // Вы можете добавлять строки с нужными ID блоков попапов, или добавить общий класс вида .uc-class, если код будет использоваться на многих страницах. Внимание! Если на странице несколько попапов - каждому нужен свой класс, или добавление через ID

    function fillPopup(id) {
        const $popup = $(id);
        const ids = $popup.find('.t390__descr').text().split(',');
        $popup.find('.t390__descr').html('');

        $(document).ready(() => {
            setTimeout(addBlocks, 0);
        });

        function addBlocks() {
            const ready = ids.every((id) => {
                if ($(id).find('[data-slider-transition]').length && $(id).find('[data-slider-transition]:not([data-slider-initialized="true"])').length) {
                    return false;
                }

                return true;
            });

            if (!ready) {
                setTimeout(addBlocks, 300);
                return;
            }

            ids.forEach((id) => {
                if (!$(id).length) {
                    return;
                }

                $popup.find('.t390__descr').append($(id));
            });
        }
    }
</script>
Вопросы и комментарии
Made on
Tilda