我想知道将鼠标悬停在元素上时扩展元素大小/缩放的最佳方法是:CSS 还是 jQuery?
我用 CSS 过渡做了这个小提琴,但它没有做我想要的,宽度和高度的大小不平滑且不成比例:
<div></div>
div{
width: 300px;
height: 300px;
background: #aa00aa;
-moz-transition: height 0.3s ease-in-out;
-webkit-transition: height 0.3s ease-in-out;
-o-transition: height 0.3s ease-in-out;
transition: height 0.3s ease-in-out;
-moz-transition: width 0.3s ease-in-out;
-webkit-transition: width 0.3s ease-in-out;
-o-transition: width 0.3s ease-in-out;
transition: width 0.3s ease-in-out;
}
div:hover{
background: #aa00aa;
height: 400px;
width: 400px;
}