我想知道如何編寫jQuery以在動畫完成時顯示隱藏按鈕。按鈕必須刷新該動畫,以便用戶可以再次觀看動畫。動畫完成時顯示刷新按鈕?
小提琴這裏: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)
});