PageSourceSearch

https://vcoelectrical.co.uk/js/script.js

js vcoelectrical.co.uk collected 2026-10-07 05:24:11 UTC 1,126 bytes, 34 lines download raw bytes

1(function () {
2  'use strict';
3
4  var hamburger = document.getElementById('hamburger');
5  var mobileNav = document.getElementById('mobile-nav');
6
7  if (hamburger && mobileNav) {
8    hamburger.addEventListener('click', function () {
9      var open = mobileNav.classList.toggle('open');
10      hamburger.classList.toggle('open', open);
11      hamburger.setAttribute('aria-expanded', open);
12    });
13  }
14
15  if (mobileNav) {
16    mobileNav.querySelectorAll('a').forEach(function (link) {
17      link.addEventListener('click', function () {
18        mobileNav.classList.remove('open');
19        if (hamburger) {
20          hamburger.classList.remove('open');
21          hamburger.setAttribute('aria-expanded', 'false');
22        }
23      });
24    });
25  }
26
27  var currentPath = window.location.pathname.replace(/\.html$/, '').replace(/\/$/, '') || '/';
28  document.querySelectorAll('.header-nav a, .mobile-nav a').forEach(function (a) {
29    var href = a.getAttribute('href');
30    if (!href) return;
31    var linkPath = href.replace(/\.html$/, '').replace(/\/$/, '') || '/';
32    if (linkPath === currentPath) a.classList.add('active');
33  });
34})();

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.