【发布时间】:2013-10-16 05:40:57
【问题描述】:
我有以下 javascript 用于更改 div 的高度。 但是,我不知道如何在 div 显示时调整速度。 我知道 500 是 div 高度变为 30px,但我不知道当它变回 100% 时如何控制速度。 谁能帮忙?
$(document).ready(function(){
$("#mydiv").click(function(){
var $this = $('#mydiv_2');
$this.animate({height: $this.height() == 30 ? '100%' : 30}, 500);
});
});
【问题讨论】:
标签: javascript jquery html jquery-animate height