这样的事情可能有用:
$("#div").toggle(
function(){
$("#div").animate( { height:"500px" }, { queue:false, duration:500 });
},
function(){
$("#div").animate( { height:"50px" }, { queue:false, duration:500 });
});
Run Code Online (Sandbox Code Playgroud)
而不是500px它可以只是div的原始大小,30px然而,当它意味着被隐藏时,你可以显示很多.