PageSourceSearch

https://www.hoteltentrem.com/wp-content/themes/tentrem-core/js/slideshow.js?02_43_00&ver=1.2.3

js hoteltentrem.com collected 2026-10-05 03:30:14 UTC 3,405 bytes, 102 lines download raw bytes

1( function ($) {
2
3    $(document).ready(function () {
4        doSlideshow();
5    });
6
7    function lazySlide(array, index) {
8        var sources = $(array[index]).find('source');
9        var img = $(array[index]).find('img');
10        var src = img.attr('data-src');
11
12        sources.each(function () {
13            var source = $(this).attr('data-srcset');
14            $(this).attr('srcset', source);
15            $(this).attr('data-processed', 'true');
16            $(this).removeAttr('data-srcset');
17
18        });
19        img.attr('src', src);
20        img.attr('data-processed', 'true');
21        img.removeAttr('data-src');
22    }
23
24    function doSlideshow() {
25        var wrap = $('#slideshow');
26        var ss_lenght = wrap.find('.slide').length;
27
28        if (wrap.length > 0) {
29            //LAZY LOADING (before carousel is loaded)
30            wrap.on("init", function () {
31
32                //load 1st, 2nd and last slide
33                var slides = wrap.find('.slide');
34                var slidesLoaded = [slides[0], slides[1], slides[ss_lenght - 1]];
35
36                //items index change based on animation kind (0 to n-1 for fade, 1 to n for slide)
37                /*if (animation === false) {
38                    slidesLoaded = [slides[1], slides[2], slides[ss_lenght]];
39                }*/
40                slides.each(function (index) {
41                    lazySlide(slidesLoaded, index);
42                })
43            });
44
45            //slideshow setup
46            wrap.slick({
47                rows: 0,
48                fade: true,
49                pauseOnHover: false,
50                pauseOnFocus: false,
51                arrows: false,
52                dots: (ss_lenght > 1),
53                // autoplay: true,
54                // speed: 1500,
55                infinite: true,
56                accessibility: true,
57                // nextArrow: wrap.parent().find('.next'),
58                // prevArrow: wrap.parent().find('.prev'),
59                prevArrow: '<a class="arrow slick-prev" title="Previous slide"></a>',
60                nextArrow: '<a class="arrow slick-next" title="Next slide"></a>'
61            });
62        }
63
64        //LAZY LOADING (after carousel is loaded)
65
66        //load 1st, 2nd and last clone
67        var clones = wrap.find('.slick-cloned');
68        var clonesLoaded = [clones[0], clones[1], clones[ss_lenght - 1]];
69
70        //items index change based on animation kind (0 to n-1 for fade, -1 to n-2 for slide)
71        /*if (animation === false) {
72            clonesLoaded = [clones[0], clones[1], clones[2]];
73        }*/
74        clones.each(function (index) {
75            lazySlide(clonesLoaded, index);
76        });
77
78        wrap.on("afterChange", function (e, slick) {
79            var slides = $.merge(slick.$slides, clones);
80
81            //load next slide + 1
82            var index = slick.currentSlide + 1;
83
84            lazySlide(slides, index);
85
86            //load previous slide - 1
87            if (slick.currentSlide === 0) {
88                index = ss_lenght - 1;
89            } else {
90                index = slick.currentSlide - 1;
91            }
92            lazySlide(slides, index);
93
94            //load current slide if click on pager
95            var indexCurrent = slick.currentSlide;
96
97            lazySlide(slides, indexCurrent);
98        });
99    }
100
101
102}(jQuery) );

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.