是有辦法在一個jQuery事件添加CSS3動畫例如:反正CSS3過渡動畫添加到元素jQuery的事件
<style>
.box{
width:100px;
height:100px;
bakground-color:#000;
}
.animate{
width:0px;
-webkit-transition-property: width; -webkit-transition-duration: 500ms;
-moz-transition-property: width; -moz-transition-duration: 500ms;
}
<style>
<html>
<div class="box"></div>
<button>click me to animate</button>
$('button').click(function(){
$('.box').addClass('animate');
});
</html>
這不適合我,沒有任何反應,當按鈕被點擊。 – mcbeav 2011-04-08 01:03:13
它在小提琴中工作,但我試圖讓它工作。看起來我只是在我的實際代碼中丟失了一些東西。謝謝! – mcbeav 2011-04-08 01:08:14