- TV series-advance on-demand_free drama_watch online - Sigu Film and Television
- Download the film and television APP and watch wonderful and smooth videos
- Letter lookup
- I understand
I understand
scene
Letter lookupSigu Film and Television, advanced on-demand, free drama chasing, online viewingChinese SimplifiedSystem announcements
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();
}
});
TV series-advance on-demand_free drama_watch online - Sigu Film and TelevisionAhead of time on demand_Free chasing dramas_Watch online - Sigu Film and Television
If you have any good opinions, welcome to join the QQ group:Sigu film and television resources are collected from major websites, this website only provides web page browsing services, does not provide video resource storage, and does not participate in any video recording and uploading
If the programs collected on this site do not intend to infringe your company's copyright, please write to the email address at the bottom of the pageSigu Film and Television (sigu.cc) provides free advanced video online viewing. High-definition Blu-ray 1080P movies and TV series are analyzed online on demand, and the videos on the whole network are updated in real time as quickly as possible.Web dramaThailand