【发布时间】:2013-03-18 10:22:35
【问题描述】:
这里是注释的 JSfiddle。我正在尝试使用 jquery 为 div 的高度设置动画,这会修改 css。但是,由于该项目的动态特性,高度将是未知的,并且可以通过变量找到。
$('span').hide();
$('.span3').click(function() {
var pollheight = $(this).find('span').height().toString(); //Trying to increase the DIV += this height (actually trying to toggle it but i'll hit that bridge later.
//$(this).find('span').append(pollheight);
$(this).animate({height: '+=80'},1000); //Trying to replace +=80 with a variable
$(this).find('span').toggle(1000);
});
【问题讨论】:
标签: jquery html css jquery-animate