PageSourceSearch

https://www.worldfirst.com/app3/themes/wfrow-child/assets/js/mega-menu.js?ver=a418b969

js worldfirst.com collected 2026-10-02 02:50:44 UTC 1,532 bytes, 54 lines download raw bytes

1/*
2 * click control for submenu in Mobile
3 */
4(function () {
5  let currentUrl = window.location.href;
6  let url = new URL(currentUrl);
7  let pathname = url.pathname;
8  let pathArray = pathname.split('/');
9
10  if(pathArray.length > 2) {
11    let lastParameter = pathArray[pathArray.length - 2];
12
13    if(lastParameter) {
14      let parentElement = document.getElementById(lastParameter)
15      if (parentElement !== null) {
16        parentElement.querySelector('a').classList.add('highlighted_item');
17      }
18    }
19  }
20
21  const navMenu = document.querySelectorAll(
22    ".wf-mobile-menu .mobile-dropdown > a"
23  );
24
25  const handleToggle = document.getElementById('wf-mobile-menu');
26  if ( handleToggle ) {
27    handleToggle.addEventListener('click', function() {
28      if (document && document.body) {
29        if(document.body.style.overflow !== 'hidden') {
30          document.body.style.overflow = 'hidden';
31        } else {
32          document.body.style.overflow = '';
33        }
34      }
35    });
36  }
37
38  for (const nav of navMenu) {
39    nav.addEventListener("click", function (e) {
40      const target = e.target;
41      e.preventDefault();
42      e.stopPropagation();
43      if (target && target.nextElementSibling) {
44        if (target.classList.contains("highlighted")) {
45          target.classList.remove("highlighted");
46          target.nextElementSibling.style.display = "none";
47        } else {
48          target.classList.add("highlighted");
49          target.nextElementSibling.style.display = "block";
50        }
51      }
52    });
53  }
54})();

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.