これは私のために動作します。そしてそれはブラウザ間で互換性があります。
は基本的に、私はちょうど...しかし、:hover
に同じトランジションを追加し、これが重要です...あなたが最初のtransition
div {
background:red;
width:100px;
height:50px;
-moz-transition-property: height, width;
-webkit-transition-property: height, width;
transition-property: height, width;
-moz-transition-duration: 1s, 1s;
-webkit-transition-duration: 1s, 1s;
transition-property-duration: 1s, 1s;
-moz-transition-delay: 0, 1s;
-webkit-transition-delay: 0, 1s;
transition-property-delay: 0, 1s;
}
div:hover {
width:400px;
height:400px;
-moz-transition-property: width, height;
-webkit-transition-property: width, height;
transition-property: width, height;
-moz-transition-duration: 1s, 1s;
-webkit-transition-duration: 1s, 1s;
transition-property-duration: 1s, 1s;
-moz-transition-delay: 0, 1s;
-webkit-transition-delay: 0, 1s;
transition-property-delay: 0, 1s;
}
例にheight
とwidth
を逆にする必要があります:http://jsfiddle.net/qknMg/1/