PageSourceSearch

https://www2.lehigh.edu/themes/custom/lehigh/js/components/bootstrap-carousel.js?v=11.4.8

js lehigh.edu collected 2026-10-01 08:41:32 UTC 1,528 bytes, 39 lines download raw bytes

1document.addEventListener('DOMContentLoaded', function() {
2    var carousels = document.querySelectorAll('.carousel');
3
4    // Function to update prev and next classes based on the active slide
5    function updatePrevNextClasses(carousel) {
6        var carouselItems = carousel.querySelectorAll('.carousel-item');
7        var activeIndex = Array.from(carouselItems).findIndex(item => item.classList.contains('active'));
8
9        // Remove existing prev and next classes
10        carouselItems.forEach(item => {
11            item.classList.remove('carousel-prev', 'carousel-next');
12        });
13
14        // Add prev class to the appropriate item
15        if (activeIndex === 0) {
16            carouselItems[carouselItems.length - 1].classList.add('carousel-prev');
17        } else {
18            carouselItems[activeIndex - 1].classList.add('carousel-prev');
19        }
20
21        // Add next class to the appropriate item
22        if (activeIndex === carouselItems.length - 1) {
23            carouselItems[0].classList.add('carousel-next');
24        } else {
25            carouselItems[activeIndex + 1].classList.add('carousel-next');
26        }
27    }
28
29    // Update prev and next classes for each carousel
30    carousels.forEach(function(carousel) {
31        // Update prev and next classes when the carousel slides
32        carousel.addEventListener('slid.bs.carousel', function() {
33            updatePrevNextClasses(carousel);
34        });
35
36        // Initially update prev and next classes
37        updatePrevNextClasses(carousel);
38    });
39});

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.