PageSourceSearch

https://www.viniportugal.pt/static/js/animation-scroll-script.js

js viniportugal.pt collected 2026-10-02 08:17:55 UTC 2,578 bytes, 77 lines download raw bytes

1$(function () {
2    $(document).ready(function(){
3        
4        if($('.js-scroll-trigger-left').length) {
5            scrollAnimationLeft();
6        }
7        if($('.js-scroll-trigger-right').length) {
8            scrollAnimationRight();
9        }
10        function scrollAnimationLeft() {
11            $(".js-scroll-trigger-left").each(function () {
12                //$(this).removeClass('is-active');
13                let position = $(this).offset().top,
14                    scroll = $(window).scrollTop(),
15                    windowHeight = $(window).height();
16
17                if (scroll > position - windowHeight + 80) {
18                    $(this).addClass('is-active');
19                }
20            });
21        };
22        function scrollAnimationRight() {
23            $(".js-scroll-trigger-right").each(function () {
24                //$(this).removeClass('is-active');
25                let position = $(this).offset().top,
26                    scroll = $(window).scrollTop(),
27                    windowHeight = $(window).height();
28
29                if (scroll > position - windowHeight + 80) {
30                    $(this).addClass('is-active');
31                }
32            });
33        };
34    });
35});
36$(function () {
37
38    if ($('.js-scroll-trigger').length) {
39        scrollAnimation();
40    }
41
42    function scrollAnimation() {
43        $(window).scroll(function () {
44            $(".js-scroll-trigger").each(function () {
45                //$(this).removeClass('is-active');
46                let position = $(this).offset().top,
47                    scroll = $(window).scrollTop(),
48                    windowHeight = $(window).height();
49
50                if (scroll > position - windowHeight + 80) {
51                    $(this).addClass('is-active');
52                }
53            });
54            $(".js-scroll-trigger-left").each(function () {
55                let position = $(this).offset().top,
56                    scroll = $(window).scrollTop(),
57                    windowHeight = $(window).height();
58
59                if (scroll > position - windowHeight + 80) {
60                    $(this).addClass('is-active');
61                }
62            });
63            $(".js-scroll-trigger-right").each(function () {
64                let position = $(this).offset().top,
65                    scroll = $(window).scrollTop(),
66                    windowHeight = $(window).height();
67
68                if (scroll > position - windowHeight + 80) {
69                    $(this).addClass('is-active');
70                }
71            });
72        });
73    }
74    $(window).trigger('scroll');
75});
76
77

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.