可能重複:
How do I access style properties of pseudo-elements with jQuery?如何更改css:懸停?
首先,懸停塊將輪換40deg!
如何更改.block:單擊按鈕時從40deg懸停到80deg?
CSS
<style type="text/css">
.block{
-moz-transition:All 1s ease;
-moz-transform: rotate(1deg);
width:200px; height:100px;
background-color:#999;
}
.block:hover{
-moz-transform: rotate(40deg);
}
</style>
HTML
<button id="change">» Run</button><br><br>
<div class="block">TEST</div>
JS
<script>
$("#change").click(function(){
//???
});
</script>
':active {-moz-transform(80deg); }'? –