1document.addEventListener('DOMContentLoaded', function() { 2 const mobileFullscreenGIF = document.getElementById('mobile-fullscreen-gif'); 3 const closeButton = document.querySelector('.close-btn'); // Target the close button 4 5 // Check if the elements are found 6 if (!mobileFullscreenGIF || !closeButton) { 7 console.error("Element not found: mobileFullscreenGIF or closeButton is missing."); 8 return; // Stop further execution if elements aren't found 9 } 10 11 function checkScreenSize() { 12 const isMobile = window.innerWidth <= 768; 13 if (isMobile) { 14 mobileFullscreenGIF.classList.remove('hidden'); 15 } else { 16 mobileFullscreenGIF.classList.add('hidden'); 17 } 18 } 19 20 // Run the check on page load 21 checkScreenSize(); 22 23 // Run the check on window resize 24 window.addEventListener('resize', checkScreenSize); 25 26 // Ensure the close button hides the popup 27 closeButton.addEventListener('click', function() { 28 console.log("Close button clicked"); // Debugging message to confirm the event triggers 29 mobileFullscreenGIF.classList.add('hidden'); 30 }); 31});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.