PageSourceSearch

https://www.wurth.es/blog/wp-content/themes/covernews-pro/assets/fixed-header-script.js?ver=7.0.2

js wurth.es collected 2026-09-24 12:33:30 UTC 1,884 bytes, 71 lines download raw bytes

1jQuery(document).ready(function($){
2
3
4    // Here You can type your custom JavaScript...
5
6    var header = document.getElementById("site-navigation");
7    var page = document.getElementById("page");
8    if (header) {
9        window.onscroll = function () {
10            myFunction()
11        };
12        var sticky = header.offsetTop;
13        
14        function myFunction() {
15           
16            if (window.pageYOffset > sticky) {
17                // if(header.classList.contains("nav-down")){
18                    header.classList.add("aft-sticky-navigation");
19                    page.classList.add("aft-sticky-navigation-enabled");
20                // }
21                
22            } else {
23                header.classList.remove("aft-sticky-navigation");
24                page.classList.remove("aft-sticky-navigation-enabled");
25            }
26        }
27    }
28
29});
30
31jQuery(document).ready(function($){
32
33var didScroll;
34var lastScrollTop = 0;
35var delta = 5;
36var navbarHeight = $('#site-navigation').outerHeight();
37
38$(window).on('scroll', function(event){
39    didScroll = true;
40});
41
42setInterval(function() {
43    if (didScroll) {
44        hasScrolled();
45        didScroll = false;
46    }
47}, 250);
48
49function hasScrolled() {
50    var st = $(this).scrollTop();
51    
52    // Make sure they scroll more than delta
53    if(Math.abs(lastScrollTop - st) <= delta)
54        return;
55    
56    // If they scrolled down and are past the navbar, add class .nav-up.
57    // This is necessary so you never see what is "behind" the navbar.
58    if (st > lastScrollTop && st > navbarHeight){
59        // Scroll Down
60        $('#site-navigation').removeClass('nav-down').addClass('nav-up');
61    } else {
62        // Scroll Up
63        if(st + $(window).height() < $(document).height()) {
64            $('#site-navigation').removeClass('nav-up').addClass('nav-down');
65        }
66    }
67    
68    lastScrollTop = st;
69}
70
71});

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.