Jquery动画不改变高度自动
jquery animation not change to height auto
我有这样的css代码:
.tab_minimized {
border-radius:20px;
border: #0D68FF 16px solid;
width:200px;
height:140px;
top: 300px;
overflow:hidden;
}
我用jquery改变了它的值,代码如下:
$("#clickLaptop01").click(function() {
$("#clickDetailTab01").removeClass( "tab_hide" );
$("#clickDetailTab01").addClass( "tab_minimized").animate({
height:"500px",
width:"100%",
top:"50px",
borderWidth:"30px",
borderRadius: 45
},1500);
});
我需要将height: 500px
值更改为auto
,但如果我使用auto
,则tab_minimized
类只会变老140px
高度。它没有改变为高度auto
"。有一个简单的方法来改变高度auto
在我的css。
根据你的评论,你需要用动画改变width
和height
,高度必须改变为auto
。你可以用CSS3 transition
: