PageSourceSearch

https://bestphone.ru/bitrix/templates/my_new_template/js/about-help-swiper.js

js bestphone.ru collected 2026-09-29 23:29:59 UTC 1,034 bytes, 36 lines download raw bytes

1// Swiper для блока «Помогаем» на about.html: только при ширине ≤767px; иначе destroy.
2(function () {
3    var root = document.querySelector(".js-about-help-swiper");
4    if (!root) return;
5
6    var instance = null;
7    var mq = window.matchMedia("(max-width: 767px)");
8
9    function sync() {
10        if (typeof Swiper === "undefined") return;
11        if (mq.matches) {
12            if (!instance) {
13                instance = new Swiper(root, {
14                    slidesPerView: "auto",
15                    spaceBetween: 10,
16                    watchOverflow: true,
17                });
18            }
19        } else if (instance) {
20            instance.destroy(true, true);
21            instance = null;
22        }
23    }
24
25    if (mq.addEventListener) {
26        mq.addEventListener("change", sync);
27    } else {
28        mq.addListener(sync);
29    }
30
31    if (document.readyState === "loading") {
32        document.addEventListener("DOMContentLoaded", sync);
33    } else {
34        sync();
35    }
36})();

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.