如何获取页面内容块内部的宽度和高度(没有导航栏和工具栏),因为它因设备和操作系统而异。
我尝试将 id 赋予 content-block-inner 然后使用$$('#test').height;
,但它失败了。
<!-- Pages, because we need fixed-through navbar and toolbar, it has additional appropriate classes-->
<div class="pages navbar-through toolbar-through">
<!-- Page, data-page contains page name-->
<div data-page="index" class="page">
<!-- Scrollable page content-->
<div class="page-content">
<div class="content-block" style="margin: 0px; padding: 0px;" id="test">
<div class="content-block-inner" style="margin: 0px; padding: 0px;">
<div id="mypage" style="width:100%; height:80vh; margin: 0px; padding: 0px;">
</div>
</div>
<div class="toolbar" style="width:100%; margin: 0px; padding: 0px;" id="draw_toolbar">
<div class="toolbar-inner">
<i class="icon icon-bars" onclick="test()"></i>
<i class="icon icon-bars" onclick="test()"></i>
<i class="icon icon-bars" onclick="test()"></i>
<i class="icon icon-bars" onclick="test()"></i>
<i class="icon icon-bars" onclick="test()"></i>
</div>
</div>
</div>
</div>
</div>
</div>
的返回值$$('#test').height
;
function(){
return this[0]===window?window.innerHeight:this.length>0>parseFloat
}