PageSourceSearch

https://www.malteser-service-center.de/_assets/a0770d901807c456aa7…/JavaScript/toTopButton.js?1782908651

js malteser-service-center.de collected 2026-10-08 20:14:55 UTC 741 bytes, 27 lines download raw bytes

1document.addEventListener('DOMContentLoaded', function () {
2    initWaypoint();
3    initToTopButton();
4});
5
6function initWaypoint() {
7    window.addEventListener('scroll', function () {
8        const toTop = document.getElementById('toTop');
9        if (toTop) {
10            toTop.classList.toggle('to-top-button--visible', window.scrollY >= 1200);
11        }
12    });
13}
14
15function initToTopButton() {
16    const toTop = document.getElementById('toTop');
17    if (toTop) {
18        requestAnimationFrame(() => {
19            toTop.classList.add('to-top-button--js');
20        });
21
22        toTop.addEventListener('click', function (e) {
23            e.preventDefault();
24            window.scrollTo({ top: 0, behavior: 'smooth' });
25        });
26    }
27}

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.