【发布时间】:2013-04-04 07:06:14
【问题描述】:
我有一个内容 div,我想将其设置为特定高度 (50px),然后单击更改为“自动”- 我可以使用 jQuery 来完成这项工作吗?我在 YUI 中有它,请参阅下面的代码
function toggleContent(p, showFull) {
if (showFull) {
YAHOO.util.Dom.setStyle(p, 'height', 'auto');
p.setAttribute('onclick', "toggleContent(this, false);")
} else {
YAHOO.util.Dom.setStyle(p, 'height', '50px');
p.setAttribute('onclick', "toggleContent(this, true);")
}
}
【问题讨论】:
标签: jquery-animate jquery