-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdengdai.js
66 lines (59 loc) · 1.54 KB
/
dengdai.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// 获取表单元素和提交按钮元素
var form = document.querySelector('form');
var submitBtn = form.querySelector('input[type="submit"]');
document.head.appendChild(style);
// 禁用提交按钮
var style = document.createElement('style');
// 给表单的提交按钮添加事件监听器
form.addEventListener('submit', function(e) {
style.innerHTML = `
.popup {
position: absolute;
left: 182px;
top: 86.8px;
width: 308px;
height: 107px;
opacity: 1;
font-size: 73.3px;
font-weight: 700;
letter-spacing: 0px;
line-height: 0px;
color: rgba(0, 216, 255, 1);
text-align: center;
vertical-align: top;
}
`;
// 创建弹窗元素
var popup = document.createElement('div');
popup.classList.add('popup');
popup.textContent = '正在提交...';
submitBtn.disabled = true;
// 将弹窗添加到页面中
document.body.appendChild(popup);
var style = document.createElement('style');
style.innerHTML = `
.popup {
position: absolute;
left: 182px;
top: 86.8px;
width: 308px;
height: 107px;
opacity: 1;
font-size: 73.3px;
font-weight: 700;
letter-spacing: 0px;
line-height: 0px;
color: rgba(0, 216, 255, 1);
text-align: center;
vertical-align: top;
}
`;
document.head.appendChild(style);
// 关闭弹窗并启用提交按钮
setTimeout(function() {
document.body.removeChild(popup);
submitBtn.disabled = false;
}, 10000);
// 阻止表单提交的默认行为
// e.preventDefault();
});