我正在尝试在快速拨号框中显示滚动列表,但定位有问题
我想知道列表对象何时太大而无法容纳框,但据我所知,无法以像素为单位获取框的大小
如何获得最小化模式以准确显示在正常模式下看到的内容但适合盒子?
这是我现在使用的 CSS
* {
margin: 0;
padding: 0;
}
html {
height: 100%;
}
body {
background: #eee;
color: #444;
display: table;
height: 100%;
width: 100%;
}
output {
position:absolute;
width: 100%;
white-space:nowrap;
font-family: monospace;
}
如果我在选项卡中打开文件,它可以正常工作,但在快速拨号中它会放大显示
Opera 的指南使用这个查询:
@media screen and (view-mode: minimized) { }
我认为它控制了它在快速拨号中的显示方式。但我不知道在里面放什么
更新 好,我最终创建了一个元素并分配了一个底部值 0
像这样:
var bottom = document.createElement('div');
bottom.className= "ylimit";
document.body.appendChild(bottom);
在 CSS 中:
div.ylimit{
position:absolute;
bottom:0px;
}
然后每当我想检查或比较高度时,我都会使用 bottom.offsetHeight