Chaitanya895 commited on
Commit
48ce4ed
·
1 Parent(s): 2125311

Update static/js/script.js

Browse files
Files changed (1) hide show
  1. static/js/script.js +10 -6
static/js/script.js CHANGED
@@ -38,26 +38,23 @@ document.addEventListener('DOMContentLoaded', () => {
38
  dropdowns.forEach(dropdown => {
39
  const button = dropdown.querySelector('.dropdown-button');
40
  const content = dropdown.querySelector('.dropdown-content');
41
-
42
  if (button && content) {
43
- // Toggle dropdown on click for mobile
44
  button.addEventListener('click', (e) => {
45
  e.preventDefault();
46
  const isActive = dropdown.classList.contains('active');
47
- // Close all dropdowns
48
  document.querySelectorAll('.dropdown').forEach(d => d.classList.remove('active'));
49
- // Toggle current dropdown
50
  if (!isActive) {
51
  dropdown.classList.add('active');
 
52
  }
53
  });
54
-
55
- // Close dropdown when clicking outside
56
  document.addEventListener('click', (e) => {
57
  if (!dropdown.contains(e.target)) {
58
  dropdown.classList.remove('active');
59
  }
60
  });
 
 
61
  }
62
  });
63
 
@@ -65,5 +62,12 @@ document.addEventListener('DOMContentLoaded', () => {
65
  const sections = document.querySelectorAll('.hero, .about, .features, .contact');
66
  sections.forEach(section => {
67
  section.style.display = 'block';
 
 
 
 
 
 
 
68
  });
69
  });
 
38
  dropdowns.forEach(dropdown => {
39
  const button = dropdown.querySelector('.dropdown-button');
40
  const content = dropdown.querySelector('.dropdown-content');
 
41
  if (button && content) {
 
42
  button.addEventListener('click', (e) => {
43
  e.preventDefault();
44
  const isActive = dropdown.classList.contains('active');
 
45
  document.querySelectorAll('.dropdown').forEach(d => d.classList.remove('active'));
 
46
  if (!isActive) {
47
  dropdown.classList.add('active');
48
+ console.log(`Dropdown toggled: ${button.textContent}`);
49
  }
50
  });
 
 
51
  document.addEventListener('click', (e) => {
52
  if (!dropdown.contains(e.target)) {
53
  dropdown.classList.remove('active');
54
  }
55
  });
56
+ } else {
57
+ console.warn('Dropdown button or content missing:', dropdown);
58
  }
59
  });
60
 
 
62
  const sections = document.querySelectorAll('.hero, .about, .features, .contact');
63
  sections.forEach(section => {
64
  section.style.display = 'block';
65
+ console.log(`Section visible: ${section.className}`);
66
+ });
67
+
68
+ // Debug Navigation
69
+ const navLinks = document.querySelectorAll('.nav-link');
70
+ navLinks.forEach(link => {
71
+ console.log(`Nav link: ${link.textContent}, href: ${link.href}`);
72
  });
73
  });