PageSourceSearch

https://sensacionformosa.com.ar//wp-content/themes/radiosensacion/js/jcarousellite.js

js sensacionformosa.com.ar collected 2026-09-24 14:33:12 UTC 5,530 bytes, 139 lines download raw bytes

1(function($) {                                          // Compliant with jquery.noConflict()
2$.fn.jCarouselLite = function(o) {
3    o = $.extend({
4        btnPrev: null,
5        btnNext: null,
6        btnGo: null,
7        mouseWheel: true,
8        auto: 7500,
9
10        speed: 1000,
11        easing: 'easeOutExpo',
12
13        vertical: false,
14        circular: true,
15        visible: 4,
16        start: 0,
17        scroll: 1,
18
19        beforeStart: null,
20        afterEnd: null
21    }, o || {});
22
23    return this.each(function() {                           // Returns the element collection. Chainable.
24
25        var running = false, animCss=o.vertical?"top":"left", sizeCss=o.vertical?"height":"width";
26        var div = $(this), ul = $("ul", div), tLi = $("li", ul), tl = tLi.size(), v = o.visible;
27
28        if(o.circular) {
29            ul.prepend(tLi.slice(tl-v-1+1).clone())
30              .append(tLi.slice(0,v).clone());
31            o.start += v;
32        }
33
34        var li = $("li", ul), itemLength = li.size(), curr = o.start;
35        div.css("visibility", "visible");
36
37        li.css({overflow: "hidden", float: o.vertical ? "none" : "left"});
38        ul.css({margin: "0", padding: "0", position: "relative", "list-style-type": "none", "z-index": "100",  "visibility": "visible"});
39        div.css({overflow: "hidden", position: "relative", "z-index": "100", left: "0px"});
40
41        var liSize = o.vertical ? height(li) : width(li);   // Full li size(incl margin)-Used for animation
42        var ulSize = liSize * itemLength;                   // size of full ul(total length, not just for the visible items)
43        var divSize = liSize * v;                      // size of entire div(total length for just the visible items)
44
45        li.css({width: li.width(), height: li.height()});
46        ul.css(sizeCss, ulSize+"px").css(animCss, -(curr*liSize));
47
48        div.css(sizeCss, divSize+"px");
48                     // Width of the DIV. length of visible images
49
50        if(o.btnPrev)
51            $(o.btnPrev).click(function() {
52                return go(curr-o.scroll);
53            });
54
55        if(o.btnNext)
56            $(o.btnNext).click(function() {
57                return go(curr+o.scroll);
58            });
59
60        if(o.btnGo)
61            $.each(o.btnGo, function(i, val) {
62                $(val).click(function() {
63                    return go(o.circular ? o.visible+i : i);
64                });
65            });
66
67        if(o.mouseWheel && div.mousewheel)
68            div.mousewheel(function(e, d) {
69                return d>0 ? go(curr-o.scroll) : go(curr+o.scroll);
70            });
71
72        if(o.auto)
73            setInterval(function() {
74                go(curr+o.scroll);
75            }, o.auto+o.speed);
76
77        function vis() {
78            return li.slice(curr).slice(0,v);
79        };
80
81        function go(to) {
82            if(!running) {
83
84                if(o.beforeStart)
85                    o.beforeStart.call(this, vis());
86
87                if(o.circular) {            // If circular we are in first or last, then goto the other end
88                    if(to<=o.start-v-1) {           // If first, then goto last
89                        ul.css(animCss, -((itemLength-(v*2))*liSize)+"px");
90                        // If "scroll" > 1, then the "to" might not be equal to the condition; it can be lesser depending on the number of elements.
91                        curr = to==o.start-v-1 ? itemLength-(v*2)-1 : itemLength-(v*2)-o.scroll;
92                    } else if(to>=itemLength-v+1) { // If last, then goto first
93                        ul.css(animCss, -( (v) * liSize ) + "px" );
94                        // If "scroll" > 1, then the "to" might not be equal to the condition; it can be greater depending on the number of elements.
95                        curr = to==itemLength-v+1 ? v+1 : v+o.scroll;
96                    } else curr = to;
97                } else {                    // If non-circular and to points to first or last, we just return.
98                    if(to<0 || to>itemLength-v) return;
99                    else curr = to;
100                }                           // If neither overrides it, the curr will still be "to" and we can proceed.
101
102                running = true;
103
104                ul.animate(
105                    animCss == "left" ? { left: -(curr*liSize) } : { top: -(curr*liSize) } , o.speed, o.easing,
106                    function() {
107                        if(o.afterEnd)
108                            o.afterEnd.call(this, vis());
109                        running = false;
110                    }
111                );
112                // Disable buttons when the carousel reaches the last/first, and enable when not
113                if(!o.circular) {
114                    $(o.btnPrev + "," + o.btnNext).removeClass("disabled");
115                    $( (curr-o.scroll<0 && o.btnPrev)
116                        ||
117                       (curr+o.scroll > itemLength-v && o.btnNext)
118                        ||
119                       []
120                     ).addClass("disabled");
121                }
122
123            }
124            return false;
125        };
126    });
127};
128
129function css(el, prop) {
130    return parseInt($.css(el[0], prop)) || 0;
131};
132function width(el) {
133    return  el[0].offsetWidth + css(el, 'marginLeft') + css(el, 'marginRight');
134};
135function height(el) {
136    return el[0].offsetHeight + css(el, 'marginTop') + css(el, 'marginBottom');
137};
138
139})(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.