PageSourceSearch

https://longbien.edu.vn/js/qi-trinh-chieu.js?v=1

js longbien.edu.vn collected 2026-10-08 20:42:51 UTC 3,597 bytes, 67 lines download raw bytes

1/* =============================================================================
2   KHỞI TẠO KHỐI TRÌNH CHIẾU ĐẦU TRANG (Swiper) — TRANG CHỦ MÁY TÍNH
3   Cặp với: QIWEB_BO … ViewComponents/HomeTabViewComponents.cs → view TieuDiemRp
4            Pages/Shared/Partials/_TieuDiemRp.cshtml   (markup)
5            wwwroot/App_Themes/all/allcss/qi-trinh-chieu.css  (kiểu dáng)
6
7   Thay cho bộ `amazingslider` + `jquery1.12.4.js` của bản cũ (2026-08-12). Tham số lấy ĐÚNG bản rp
8   (`qi-home-rp.js` → napSlideTieuDiem) để hai bản chạy giống hệt nhau; bản rp vốn đã dựng lại theo
9   đúng số đo trong `initslider.js`:
10     slideinterval 5000 · transition "slide" (duration 1000) · autoplay · pauseonmouseover ·
11     enabletouchswipe · loop · dải ảnh nhỏ ở đáy (navspacing 8) · thanh thời gian.
12
13   Không có JS thì khối vẫn hiện tin đầu (Swiper.css cho `.swiper-slide` bề rộng 100%) — không trắng trang.
14   ========================================================================== */
15(function () {
16    'use strict';
17
18    function nap() {
19        var khung = document.querySelector('.qirp-slide');
20        //  `khung.swiper` là instance Swiper 8 gắn sẵn vào phần tử ⇒ dùng để KHÔNG khởi tạo hai lần
21        //  (hàm này gọi ở cả DOMContentLoaded lẫn window.load).
22        //  Cũng nhờ vậy mà trên địa chỉ …rp — nơi `qi-home-rp.js` đã khởi tạo rồi — tệp này tự đứng im.
23        if (!khung || khung.swiper || typeof window.Swiper !== 'function') return;
24
25        var nhieuTin = khung.querySelectorAll('.swiper-slide').length > 1;
26
27        // Dải ảnh nhỏ: khởi tạo TRƯỚC để truyền vào trình chiếu chính qua module thumbs.
28        var khungThumb = document.querySelector('.qirp-slide-thumb');
29        var slideThumb = null;
30        if (khungThumb && nhieuTin) {
31            slideThumb = new window.Swiper(khungThumb, {
32                slidesPerView: 'auto',
33                spaceBetween: 8,            // navspacing 8
34                freeMode: true,             // kéo tay được như dải ảnh nhỏ bản cũ
35                watchSlidesProgress: true,
36                slideToClickedSlide: true
37            });
38        }
39
40        var slideChinh = new window.Swiper(khung, {
41            loop: nhieuTin,
42            speed: 1000,                    // slide.duration 1000
43            observer: true,
44            observeParents: true,
45            resizeObserver: true,
46            autoplay: nhieuTin ? { delay: 5000, disableOnInteraction: false, pauseOnMouseEnter: true } : false,
47            navigation: {
48                prevEl: khung.querySelector('.swiper-button-prev'),
49                nextEl: khung.querySelector('.swiper-button-next')
50            },
51            pagination: { el: khung.querySelector('.qirp-slide-timer'), type: 'progressbar' },
52            thumbs: slideThumb ? { swiper: slideThumb } : undefined,
53            keyboard: { enabled: true },
54            a11y: { prevSlideMessage: 'Tin trước', nextSlideMessage: 'Tin sau' }
55        });
56
57        window.addEventListener('resize', function () {
58            if (slideThumb) slideThumb.update();
59            slideChinh.update();
60        });
61    }
62
63    if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', nap);
64    else nap();
65    //  Swiper nạp bằng `defer` có thể xong SAU tệp này ⇒ thử lại lúc window load (hàm tự chặn chạy đôi).
66    window.addEventListener('load', nap);
67})();

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.