1
的高度我有这样的功能:jQuery的:动画到DIV
function fixedFeeSize(i){
var num1 = $('#num' + i);
if (num1.hasClass("extended")) {
num1.stop(true, true).animate({height: '59px'},500);
num1.removeClass("extended");
}else{
var height = 0;
num1.animate({height: '360px'},500);
num1.addClass("extended");
}
return null;
}
哪个扩张/收缩一个div,但我很努力得到它扩大到div每个div的高度(会有10+)将会有不同的高度。
我试过num1.animate({height: 'auto'},500);
没有工作。
[JavaScript jQuery Animate to Auto Height]的可能重复(http://stackoverflow.com/questions/5003220/javascript-jquery-animate-to-auto-height) – techfoobar 2013-02-11 16:37:09
请提供jsfiddle示例 – Dom 2013-02-11 17:30:03