HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux ubuntu-s-2vcpu-4gb-amd-sfo3-01 6.8.0-71-generic #71-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 22 16:52:38 UTC 2025 x86_64
User: root (0)
PHP: 8.2.30
Disabled: NONE
Upload Files
File: /var/www/mentalhealthsteps.com/wp-content/themes/mentalhealthworld/js/main.js
document.addEventListener("DOMContentLoaded", function () {
      const navbar = document.getElementById("navbar");
      const hamburger = document.getElementById("hamburger");
      const navLinks = document.getElementById("navLinks");
      const searchContainer = document.getElementById("searchContainer");
      const actionButtons = document.getElementById("actionButtons");

      // Toggle mobile menu when hamburger is clicked
      hamburger.addEventListener("click", () => {
        navLinks.classList.toggle("active");
        searchContainer.classList.toggle("active");
        actionButtons.classList.toggle("active");
      });

      // On scroll: if window.scrollY > 300, add .sticky; else remove
      window.addEventListener("scroll", () => {
        if (window.scrollY > 100) {
          navbar.classList.add("sticky");
        } else {
          navbar.classList.remove("sticky");
        }
      });
    });


    // tab js

     const tabs  = document.querySelectorAll('.footer-nav .tab');
    const panes = document.querySelectorAll('.tab-content > div');

    function activateTab(tabEl) {
      // clear all
      tabs.forEach(t => t.classList.remove('activate'));
      panes.forEach(p => p.classList.remove('activate'));

      // activate clicked tab + its pane
      tabEl.classList.add('activate');
      document.getElementById(tabEl.dataset.tab)
              .classList.add('activate');
    }

    // wire up clicks
    tabs.forEach(tab => {
      tab.addEventListener('click', e => {
        e.preventDefault();
        activateTab(tab);
      });
    });

    // on page load, activate the first one
    if (tabs.length) activateTab(tabs[0]);


    // home page slider js