Spaces:
Running
Running
Update script.js
Browse files
script.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
| 1 |
// Mobile menu toggle
|
| 2 |
const menuBtn = document.getElementById("mobileMenuBtn");
|
| 3 |
const navList = document.querySelector(".site-nav ul");
|
| 4 |
-
menuBtn?.addEventListener("click", () =>
|
| 5 |
-
navList?.classList.toggle("open");
|
| 6 |
-
});
|
| 7 |
|
| 8 |
// Smooth in-page scroll
|
| 9 |
document.querySelectorAll('a[href^="#"]').forEach(a => {
|
|
@@ -18,7 +16,7 @@ document.querySelectorAll('a[href^="#"]').forEach(a => {
|
|
| 18 |
});
|
| 19 |
});
|
| 20 |
|
| 21 |
-
//
|
| 22 |
document.getElementById("contactForm")?.addEventListener("submit", (e) => {
|
| 23 |
e.preventDefault();
|
| 24 |
alert("Thanks! Your request has been received. We will contact you shortly.");
|
|
@@ -26,7 +24,7 @@ document.getElementById("contactForm")?.addEventListener("submit", (e) => {
|
|
| 26 |
|
| 27 |
// WhatsApp CTA
|
| 28 |
function openWhatsApp(){
|
| 29 |
-
const phone = "+919876543210";
|
| 30 |
const text = encodeURIComponent("Hello Securetronics, I’d like a free site survey.");
|
| 31 |
window.open(`https://wa.me/${phone}?text=${text}`, "_blank");
|
| 32 |
}
|
|
|
|
| 1 |
// Mobile menu toggle
|
| 2 |
const menuBtn = document.getElementById("mobileMenuBtn");
|
| 3 |
const navList = document.querySelector(".site-nav ul");
|
| 4 |
+
menuBtn?.addEventListener("click", () => navList?.classList.toggle("open"));
|
|
|
|
|
|
|
| 5 |
|
| 6 |
// Smooth in-page scroll
|
| 7 |
document.querySelectorAll('a[href^="#"]').forEach(a => {
|
|
|
|
| 16 |
});
|
| 17 |
});
|
| 18 |
|
| 19 |
+
// Demo contact handler
|
| 20 |
document.getElementById("contactForm")?.addEventListener("submit", (e) => {
|
| 21 |
e.preventDefault();
|
| 22 |
alert("Thanks! Your request has been received. We will contact you shortly.");
|
|
|
|
| 24 |
|
| 25 |
// WhatsApp CTA
|
| 26 |
function openWhatsApp(){
|
| 27 |
+
const phone = "+919876543210"; // replace with actual number
|
| 28 |
const text = encodeURIComponent("Hello Securetronics, I’d like a free site survey.");
|
| 29 |
window.open(`https://wa.me/${phone}?text=${text}`, "_blank");
|
| 30 |
}
|