Spaces:
Running
Running
| // Global functions and event listeners | |
| document.addEventListener('DOMContentLoaded', function() { | |
| // Mobile menu toggle functionality | |
| const mobileMenuButton = document.getElementById('mobile-menu-button'); | |
| const mobileMenu = document.getElementById('mobile-menu'); | |
| if(mobileMenuButton && mobileMenu) { | |
| mobileMenuButton.addEventListener('click', function() { | |
| mobileMenu.classList.toggle('hidden'); | |
| }); | |
| } | |
| // Product search functionality | |
| const searchForm = document.getElementById('search-form'); | |
| if(searchForm) { | |
| searchForm.addEventListener('submit', function(e) { | |
| e.preventDefault(); | |
| const searchInput = document.getElementById('search-input'); | |
| alert(`Searching for: ${searchInput.value}`); | |
| // In a real app, you would redirect to search results | |
| }); | |
| } | |
| // Initialize any other global functionality here | |
| }); |