JavaScript

Profile Picture

visheshnamdev72

Sunday, 2024-07-21



JavaScript

Finally, use JavaScript to hide the preloader once the page has fully loaded. Create a file named script.js and add the following code:

// Wait for the window to fully load
window.addEventListener('load', function () {
    // Hide the preloader
    const preloader = document.getElementById('preloader');
    preloader.style.display = 'none';


    // Show the main content
    const content = document.getElementById('content');
    content.style.display = 'block';
});