我有一個包含三個框的頁面。我試圖發生的事情是,當我點擊第三個盒子時,盒子1被提示以一種速度消失,並在較慢的盒子中消失兩個盒子。提示Webkit轉換
<html>
<head>
<style>
div.box { /* this style applies only to the 'before' transition state */
opacity:1;}
div.fadeAway { /* give the transition rules to "after" state */
opacity:0;
-webkit-transition-property: opacity;
-webkit-transition-duration: 2s; }
div.fadeAway2 { /* give the transition rules to "after" state */
opacity:0;
-webkit-transition-property: opacity;
-webkit-transition-duration: 5s; }
</style>
</script>
</head>
<body>
<div class="box"
style="width:100px;
height:100px;
background-color:green;">
Tap to fade
</div>
<div class="box2"
style="width:100px;
height:100px;
background-color:red;">
Tap to fade
</div>
<div class="box3"
style="width:100px;
height:100px;
background-color:blue;"
this.onclick=".box2 .box3.className = 'fadeaway''fadeaway2'">
Tap to fade
</div>
</body>
</html>
在此先感謝您的幫助。
這裏是我放在一起搗鼓它http://jsfiddle.net/mCjmt/ – loriensleafs 2012-03-05 20:10:15