我正在學習CSS3現在我可以運行動畫文窗口打開,但如果我點擊任何class和id,然後只將動畫,我需要請任何一個幫助我如何使用css3單擊類或id時動畫?
<html>
<div id="test" class="target animate">Try me</div>
<div class="fff" style="width:100px;height:100px;background:#4AB72F"><h3>click here</h3></div>
<style>
#test {
width:160px;
height:200px;
margin: 100px;
background:#68C6F2;
-webkit-transition: all 1s ease-in-out;
-moz-transition: all 1s ease-in-out;
-ms-transition: all 1s ease-in-out;
-o-transition: all 1s ease-in-out;
transition: all 1s ease-in-out;
}
#test.animate {
-moz-animation-name: test;
-moz-animation-duration: 1s;
}
@keyframes test{
from { -moz-transform: translateX(-100%) scale(.1) rotateY(-50deg);}
}
</style>
</html>
我使用Firefox瀏覽器,很好地工作,但我需要,如果我點擊任何類或身份證,那麼只有它會動畫,任何人請協助我(或者你可以告訴我喜歡使用jquery它會對我很有幫助)謝謝
要反對在運行時的動畫? –