PageSourceSearch

https://core-xp.ru/local/templates/main_new/components/bitrix/news.list/parthers/script.js?17639855611583

js core-xp.ru collected 2026-09-28 08:43:09 UTC 1,583 bytes, 40 lines download raw bytes

1document.addEventListener('DOMContentLoaded', function() {
2    const container = document.querySelector('.marquee-container');
3    const track = document.getElementById('marqueeTrack');
4    const isMobile = window.matchMedia('(max-width: 768px)').matches;
5
6    if (!isMobile) {
7        // Рассчитываем общую ширину элементов
8        let totalWidth = 0;
9        const items = track.children;
10
11        Array.from(items).forEach(item => {
12            const style = window.getComputedStyle(item);
13            totalWidth += item.offsetWidth +
14                parseInt(style.marginRight) +
15                parseInt(style.marginLeft);
16        });
17
18        // Клонируем элементы до заполнения 200% ширины экрана
19        const containerWidth = container.offsetWidth;
20        let clonesCount = 0;
21
22        while (track.offsetWidth < containerWidth * 2) {
23            Array.from(items).forEach(item => {
24                const clone = item.cloneNode(true);
25                track.appendChild(clone);
26            });
27            clonesCount++;
28
29            // Защита от бесконечного цикла
30            if (clonesCount > 10) break;
31        }
32
33        // Настраиваем анимацию
34        const singleLoopWidth = totalWidth + (items.length * 20); // 20px margin-right
35        const animationDuration = (singleLoopWidth * 2) / 50; // 50px/s скорость
36
37        track.style.animationDuration = `${animationDuration}s`;
38        track.style.width = `${singleLoopWidth * 2}px`;
39    }
40});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.