PageSourceSearch

https://www.tjam.jus.br/modules/mod_tjam_youtube/assets/slideControl.js

js tjam.jus.br collected 2026-10-02 06:16:53 UTC 2,735 bytes, 81 lines download raw bytes

1jQuery.noConflict();
2    jQuery('#mod-videos-tjam-youtube').ready(function () {
3
4        var carousel = jQuery('#mvty-carousel ul')
5            carouselChild = carousel.find('li')
6            clickCount = 0
7            itemWidth = carousel.find('li:first').width() + 1; //Including margin
8
9	
10        //Set Carousel width so it won't wrap
11        carousel.width(itemWidth * carouselChild.length);
12
13        //Place the child elements to their original locations.
14        refreshChildPosition();
15
16
17        jQuery(this).find('.bntNav').click(function () {
18            controlButton(jQuery(this).val());
19        });
20
21        //Set the event handlers for buttons.
22        function next() {
23
24            let w = ((carouselChild.length - 1) * (itemWidth)) + (clickCount * itemWidth);
25
26            //Animate the slider to left as item width 
27            carousel.finish().animate({
28                left: '-=' + itemWidth
29            }, 700, function () {
30                //Find the first item and append it as the last item.
31                lastItem = carousel.find('li:first');
32                lastItem.remove().appendTo(carousel);
33                lastItem.css('left', w);
34            });
35        }
36
37        function previous() {
38
39            //Find the first item and append it as the last item.
40            lastItem = carousel.find('li:last');
41            lastItem.remove().prependTo(carousel);
42
43            lastItem.css('left', itemWidth * clickCount);
44            //Animate the slider to right as item width 
45            carousel.finish().animate({
46                left: '+=' + itemWidth
47            }, 700);
48        }
49
50
51        function refreshChildPosition() {
52            carouselChild.each(function () {
53                jQuery(this).css('left', itemWidth * carouselChild.index(jQuery(this)));
54            });
55        }
56
57        function controlButton(value) {
58
59            if ("next" == value) {
60                clickCount++;
61                next();
62            }
63            else {
64                clickCount--;
65                previous();
66            };
67
68            if (clickCount <= 10 && clickCount >= -10) {
69                jQuery('button[value=next]').prop('disabled',false);
70                jQuery('button[value=previous]').prop('disabled',false);
71            } else if (clickCount > 10){
72                jQuery('button[value=next]').prop('disabled',true);
73                jQuery('button[value=previous]').prop('disabled',false);
74            }else if (clickCount < -10){
75                jQuery('button[value=next]').prop('disabled',false);
76                jQuery('button[value=previous]').prop('disabled',true);
77            }
78
79        }
80
81    });

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.