-1

我的 html 页面中有一个 dd 元素,类名是从数据库 id 生成的,并且在我使用的 Java 脚本文件中

theHeight=200;
$("dd."+i).css({height: theHeight});

此代码在 Opera、chrome、IE 8 中运行良好,但在 FireFox 12.0 中不起作用我需要更改 css 中元素的高度,但在 jquery 的运行时。它有什么问题,有什么方法可以使它与 FireFox 一起使用

谢谢

4

1 回答 1

1

尝试这样设置:

theHeight=200
$("dd."+i).height(theHeight);

或者尝试将 'px' 附加到高度值:

theHeight=200
$("dd."+i).css({height: theHeight + 'px'});
于 2012-06-14T14:42:24.750 回答