gpt4 book ai didi

jquery - 动画完成时显示刷新按钮?

转载 作者:太空宇宙 更新时间:2023-11-03 20:16:42 27 4
gpt4 key购买 nike

我想知道如何编写 jQuery 以在动画完成时显示隐藏按钮。 Button 必须刷新该动画,以便用户可以再次观看该动画。

在这里摆弄:http://jsfiddle.net/rabelais/ZeMcP/

HTML

<div class="bar1"><div class="alt0"></div></div>

<div id="button"><a href="#">refresh</a></div>

CSS

.bar1 {
width: 200px;
height: 20px;
background-color: black;
}
.alt0 {
width: 0px;
height: 20px;
background-color: orange;
}
#button {
display: none;
}

jQuery

$('.bar1').mouseenter(function(){
$('.alt0').animate({width: "200px"}, 1000)
});

最佳答案

你可以添加完整的功能

$('.bar1').mouseenter(function () {
$('.alt0').animate({
width: "200px",
complete: function () {
$("#button").toggle();
}
}, 1000)
});

关于jquery - 动画完成时显示刷新按钮?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19332449/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com