Film library
Ahead of time on demand_Free chasing dramas_Watch online - Sigu Film and Television

Get the element
        const gonggao = document.getElementById('gonggao');
        const closeBtn = gonggao.querySelector('.gonggao-close');
        const confirmBtn = gonggao.querySelector('.gonggao-confirm');
        Store the key name
        const STORAGE_KEY = 'gonggao_closed_time';
        Check if the pop-up window should appear
        function shouldShowGonggao() {
            const closedTime = localStorage.getItem(STORAGE_KEY);
            if (!closedTime) {
                return true; Never closed, shown
            }
            
const now = new Date().getTime();
            const diff = now - parseInt(closedTime);
            
If it exceeds 24 hours, a pop-up window will appear
            return diff > 24 * 60 * 60 * 1000;
        }
        
A pop-up window is displayed
        function showGonggao() {
            gonggao.classList.add('active');
            document.body.style.overflow = 'hidden'; Prevent background scrolling
        }
        
Close the pop-up window and log the time
        function closeGonggao() {
            gonggao.classList.remove('active');
            document.body.style.overflow = 'auto'; Resume background scrolling
            
Record the shutdown time
            localStorage.setItem(STORAGE_KEY, new Date().getTime().toString());
        }
        
Automatically display pop-ups after page loading (if needed)
        document.addEventListener('DOMContentLoaded', function() {
            Delay the display by 1 second to let the page load first
            setTimeout(function() {
                if (shouldShowGonggao()) {
                    showGonggao();
                }
            }, 1000);
        });
        
bind closure events
        closeBtn.addEventListener('click', closeGonggao);
        confirmBtn.addEventListener('click', closeGonggao);
        
Click Background Off
        gonggao.addEventListener('click', function(e) {
            if (e.target === gonggao) {
                closeGonggao();
            }
        });
        
ESC key is off
        document.addEventListener('keydown', function(e) {
            if (e.key === 'Escape' && gonggao.classList.contains('active')) {
                closeGonggao();
            }
        });

comedy

Get the element const gonggao = document.getElementById('gonggao'); const closeBtn = gonggao.querySelector('.gonggao-close'); const confirmBtn = gonggao.querySelector('.gonggao-confirm'); Store the key name const STORAGE_KEY = 'gonggao_closed_time'; Check if the pop-up window should appear function shouldShowGonggao() { const closedTime = localStorage.getItem(STORAGE_KEY); if (!closedTime) { return true; Never closed, shown } const now = new Date().getTime(); const diff = now - parseInt(closedTime); If it exceeds 24 hours, a pop-up window will appear return diff > 24 * 60 * 60 * 1000; } A pop-up window is displayed function showGonggao() { gonggao.classList.add('active'); document.body.style.overflow = 'hidden'; Prevent background scrolling } Close the pop-up window and log the time function closeGonggao() { gonggao.classList.remove('active'); document.body.style.overflow = 'auto'; Resume background scrolling Record the shutdown time localStorage.setItem(STORAGE_KEY, new Date().getTime().toString()); } Automatically display pop-ups after page loading (if needed) document.addEventListener('DOMContentLoaded', function() { Delay the display by 1 second to let the page load first setTimeout(function() { if (shouldShowGonggao()) { showGonggao(); } }, 1000); }); bind closure events closeBtn.addEventListener('click', closeGonggao); confirmBtn.addEventListener('click', closeGonggao); Click Background Off gonggao.addEventListener('click', function(e) { if (e.target === gonggao) { closeGonggao(); } }); ESC key is off document.addEventListener('keydown', function(e) { if (e.key === 'Escape' && gonggao.classList.contains('active')) { closeGonggao(); } });

All videos and pictures on this site are collected from the Internet, the copyright belongs to the original author, this website only provides web page services, does not provide resource storage, does not participate in recording, uploading.

System announcements
×
old All URLs will be deprecated, so please bookmark the latest domain namesigu.app
Recently, domain names have changed frequently for various reasons.
Many friends can't find their way home,
Friends who know the URL should also pass it on to friends around you, thank you!
QQ communication group: 691768255