我有 jQuery ajax 表,我需要在表体未完全加载时保持表的高度。这是我的代码:
var tableHeight = parent.height();
// set parent fixed height so page don't jump up/down during adding
parent.height(tableHeight);
// or: parent.css("height", tableHeight + "px");
$tbody.hide().empty();
// no items loaded
if (rowsData.length === 0) {
this._noItems();
} else {
this._rowAdder(rowsData, actionDisplay);
}
$tbody.show();
parent.height("auto");
- "parent"是表对象
我知道,我可以使用 css 属性“visibility”,但是例如 Mozilla 不会更改 css 样式或表格属性并且表格显示良好。我的问题是:为什么 Chromium 会忽略配置的 css 样式或表格属性高度?有人可以帮我吗?这 ;)
最佳答案
设置高度属性不像设置宽度那么容易。
在大多数情况下,如果您想让 child 知道 100% 的含义,您需要将 html 和 body 高度设置为 100%。
html,body{
height: 100%;
}
关于javascript - Chromium忽略css样式或属性高度中的表格高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22408261/