设置完成转场效果需要多少秒或毫秒。
要设置效果的持续时间,请使用JavaScript中的transitionDuration属性。
示例
您可以尝试运行以下代码以返回转换效果完成所需的秒数或毫秒数-
<!DOCTYPE html>
<html>
<head>
<style>
#div1 {
position: relative;
margin: 10px;
height: 300px;
width: 400px;
padding: 20px;
border: 2px solid blue;
}
#div2 {
padding: 80px;
position: absolute;
border: 2px solid BLUE;
background-color: yellow;
transform: rotateY(45deg);
transition: all 5s;
}
#div2:hover {
background-color: orange;
width: 50px;
height: 50px;
padding: 100px;
border-radius: 50px;
}
</style>
</head>
<body>
<p>Hover over DIV2</p>
<button onclick = "display()">Set</button>
<div id = "div1">DIV1
<div id = "div2">DIV2</div>
</div>
<script>
function display() {
document.getElementById("myDIV").style.transitionDuration = "5s";
}
</script>
</body>
</html>热门推荐
6 聚餐会祝福语简短
10 周末祝福语正能量简短
11 六一祝福语简短感动女生
12 对生活祝福语简短精辟
13 生病祝福语简短文案
14 上嫂子生日祝福语简短
15 酒桌升学祝福语简短
16 关于开车的祝福语简短
17 女生 节日祝福语简短大气
18 工厂祝福语简短的句子