62,041
社区成员
发帖
与我相关
我的任务
分享
.text
{
position: absolute;
top: 250px;
left: 500px;
width: 300px;
height: 160px;
}
var _alertPanel = document.createElement("div");
_alertPanel.setAttribute("id", this.alertLayerID);
//_alertPanel.setAttribute("class", "drag"); /*W3C*/
_alertPanel.setAttribute("className", "drag"); /*IE*/===》为什么 alert(_alertPanel.offsetHeight)的高度 不等于 160px???
//_alertPanel.style.cssText = "height: 160px;";===》alert(_alertPanel.offsetHeight)的高度就是160px;
document.body.appendChild(_alertPanel
alert(_alertPanel.offsetHeight);
.drag
{
position: absolute;
top: 250px;
left: 500px;
width: 300px;
height: 160px;
}
var _alertPanel = document.createElement("div");
_alertPanel.setAttribute("id", this.alertLayerID);
//_alertPanel.setAttribute("class", "drag"); /*W3C*/
_alertPanel.setAttribute("className", "drag"); /*IE*/===》为什么 alert(_alertPanel.offsetHeight)的高度 不等于 160px???
//_alertPanel.style.cssText = "height: 160px;";===》alert(_alertPanel.offsetHeight)的高度就是160px;
document.body.appendChild(_alertPanel
alert(_alertPanel.offsetHeight);