You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.9 KiB
53 lines
1.9 KiB
12 months ago
|
document.addEventListener('DOMContentLoaded', function () {
|
||
|
// 在这里编写你想要在页面加载完成后执行的代码
|
||
|
const bigbox = document.querySelector('#minidialog')
|
||
|
const x = document.querySelector('.closeX')
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
bigbox.style.bottom = '-99999px'
|
||
|
bigbox.style.right = '-99999px'
|
||
|
x.addEventListener('click', function () {
|
||
|
bigbox.style.bottom = '-99999px'
|
||
|
bigbox.style.right = '-99999px'
|
||
|
x.style.display = 'none'
|
||
|
})
|
||
|
|
||
|
|
||
|
// let timer = null
|
||
|
// timer = setInterval(() => {
|
||
|
// if (
|
||
|
// document.querySelector('#minidialog') &&
|
||
|
// document.querySelector('#minidialog').style.display == 'block'
|
||
|
// ) {
|
||
|
// setTimeout(() => {
|
||
|
// document.querySelector('.closeX').style.display = 'block'
|
||
|
// }, 10);
|
||
|
// document.querySelector('.closeX').style.display = 'block'
|
||
|
// document.querySelector('.closeX').addEventListener('click', function () {
|
||
|
// document.querySelector('#minidialog').style.display = 'none'
|
||
|
// document.querySelector('.closeX').style.display = 'none'
|
||
|
// })
|
||
|
// clearInterval(timer)
|
||
|
// }
|
||
|
// }, 100)
|
||
|
// let timer1 = null
|
||
|
// timer = setInterval(() => {
|
||
|
// console.log('定时器1');
|
||
|
// if (
|
||
|
// document.querySelector('#minidialog') &&
|
||
|
// document.querySelector('#minidialog').style.display == 'block'
|
||
|
// ) {
|
||
|
// setTimeout(() => {
|
||
|
// console.log('模拟点击');
|
||
|
// // document.querySelector('.closeX').click()
|
||
|
// document.querySelector('.closeX').style.display = 'none'
|
||
|
// document.querySelector('#minidialog').style.display == 'none'
|
||
|
// }, 0);
|
||
|
// console.log('清除定时器1');
|
||
|
// clearInterval(timer1)
|
||
|
// }
|
||
|
// }, 0)
|
||
|
});
|