PageSourceSearch

https://www.opigorizia.it/javascripts/header_management.js

js opigorizia.it collected 2026-10-10 02:04:54 UTC 3,163 bytes, 80 lines download raw bytes

1(function ($, window, document) {
2  'use strict';
3  var elSelector = '.fixed_header',
4    $element = $(elSelector);
5  if (!$element.length) return true;
6  var elHeight = 0,
7    elTop = 0,
8    $document = $(document),
9    dHeight = 0,
10    $window = $(window),
11    wHeight = 0,
12    wScrollCurrent = 0,
13    wScrollBefore = 0,
14    wScrollDiff = 0;
15
16  var jmediaquery = window.matchMedia("(max-width: 767px)")
17
18
19  $window.on('scroll', function () {
20    elHeight = $element.outerHeight();
21    dHeight = $document.height();
22    wHeight = $window.height();
23    wScrollCurrent = $window.scrollTop();
24    wScrollDiff = wScrollBefore - wScrollCurrent;
25    elTop = parseInt($element.css('top')) + wScrollDiff;
26    if (wScrollCurrent <= 0) {                                                                                          // scrolled to the very top; element sticks to the top
27      //console.log("sono in cima");
28      if (jmediaquery.matches) {
29        if (document.getElementById('header_management').getAttribute('data-current_page_url') === "/it") {
30          $element.removeClass('opacized');
31        }
32      } else {
33        $element.css('top', 0);
34        if (document.getElementById('header_management').getAttribute('data-current_page_url') === "/it") {
35          $element.removeClass('opacized');
36        }
37      }
38    } else if (wScrollDiff > 0) {                                                                                       // scrolled up; element slides in
39      //console.log("scrollo su")
40      if (jmediaquery.matches) {
41
42      } else {
43        $element.css('top', elTop > 0 ? 0 : elTop);
44        $element.addClass('opacized');
45      }
46    } else if (wScrollDiff < 0) {                                                                                       // scrolled down
47      //console.log("scrollo giù");
48      if (wScrollCurrent + wHeight >= dHeight - elHeight) {                                                             // scrolled to the very bottom; element slides in
49        //console.log("fine pagina");
50        //$element.css( 'top', ( elTop = wScrollCurrent + wHeight - dHeight ) < 0 ? elTop : 0 );
51      } else {                                                                                                          // scrolled down; element slides out
52        if (jmediaquery.matches) {
53          $element.addClass('opacized');
54        } else {
55          $element.css('top', Math.abs(elTop) > elHeight ? -elHeight : elTop);
56          $element.removeClass('opacized');
57        }
58      }
59    }
60    wScrollBefore = wScrollCurrent;
61  });
62
63})(jQuery, window, document);
64
65// Gestione header per Smartphone
66$(document).ready(function(){
67  var jmediaquery = window.matchMedia("(max-width: 767px)")
68  if (document.getElementById('header_management').getAttribute('data-current_page_url') !== "/it") {
69    if (jmediaquery.matches) {
70      $(".fixed_header").addClass('opacized');
71    }
72  }
73});
74
75// Gestione Header per Desktop su pagine Intenrne:
76$(document).ready(function(){
77  if (document.getElementById('header_management').getAttribute('data-current_page_url') !== "/it") {
78    $(".fixed_header").addClass('opacized');
79  }
80});

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.