【发布时间】:2020-06-19 17:17:42
【问题描述】:
我试图在按下按钮后立即加载微调器。我正在使用 Spinkit 库。目的是在单击按钮后显示微调器约 3 秒,就在页面加载之前。但是在旋转器显示之前不需要一秒钟。请看:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="spinkit.min.css">
<style>
.example {
margin: 50px 100px;
padding: 100px;
border-bottom: 1px solid #eee;
display: none;
}
.sk-plane {
height: 50px;
background-color: darkviolet;
}
</style>
<script>
function spp(){
let spi = setInterval(spiny, 3000);
};
spp();
function spiny(){
let showie = document.querySelector('.example');
showie.style.display = 'block';
};
</script>
</head>
<body>
<button class='tay' onclick='spiny()'>
<a href="#" > Press Here </a>
</button>
<center class="example">
<button class="sk-plane"> </button>
</center>
</body>
</html>
这里是 Spinkit 文件的source
【问题讨论】:
标签: javascript html spinner