PageSourceSearch

https://www.uib.cat/o/uib-theme/js/scrollToTop.js?browserId=chrome…=js&languageId=ca_ES&t=1789712858000

js uib.cat collected 2026-09-24 09:09:41 UTC 930 bytes, 32 lines download raw bytes

1/*1789712858000*/
2
3document.addEventListener('DOMContentLoaded', function() {
4    const scrollBtn = document.getElementById('scrollToTop');
5    
6    // Función para evitar spam de eventos scroll
7    let ticking = false;
8    function updateVisibility() {
9        if (window.scrollY > 300) {
10            scrollBtn.classList.add('scroll-to-top--visible');
11        } else {
12            scrollBtn.classList.remove('scroll-to-top--visible');
13        }
14        ticking = false;
15    }
16    
17    // Muestra/oculta botón según scroll
18    window.addEventListener('scroll', function() {
19        if (!ticking) {
20            requestAnimationFrame(updateVisibility);
21            ticking = true;
22        }
23    });
24    
25    // Click para desplazarse al inicio
26    scrollBtn.addEventListener('click', function() {
27        window.scrollTo({
28            top: 0,
29            behavior: 'smooth'
30        });
31    });
32});

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.