.
Book Online
document.addEventListener("DOMContentLoaded", function () {
  const OFFSET = 100;
  document.querySelectorAll('a[href^="#"]').forEach(anchor => {
    anchor.addEventListener("click", function (e) {
      const targetId = this.getAttribute("href").substring(1);
      const targetEl = document.getElementById(targetId);
      
      if (targetEl) {
        e.preventDefault();
        const targetPosition = targetEl.getBoundingClientRect().top + window.pageYOffset - OFFSET;
        window.scrollTo({
          top: targetPosition,
          behavior: "smooth"
        });
      }
    });
  });
});

Author: cesar

  • March 24, 2026
    Welcome to WordPress. This is your first post. Edit or delete it, then start writing!

We’d Love to Hear From You

Contact Us
Checkboxes