获取table高度

webUi
赵桐华 5 years ago
parent 951815a689
commit 74a835b20b
  1. 8
      frontend/views/database/b-index.php

@ -122,8 +122,7 @@ use \common\libs\MyLib;
</div> </div>
<?php $this->beginBlock('footer_js'); ?> <?php $this->beginBlock('footer_js'); ?
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table.min.js"></script> <script src="/assets/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script> <script src="/assets/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
<script src="/assets/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script> <script src="/assets/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
@ -159,7 +158,10 @@ use \common\libs\MyLib;
//table设置一定的高度 //table设置一定的高度
var tab=$("#listTable").attr('data-height'); var tab=$("#listTable").attr('data-height');
console.log($('.fixed-table-body').height()); console.log($('.fixed-table-body').height());
console.log($('.fixed-table-body').offsetHeight); var a=$('.fixed-table-body').offsetHeight;
var b=$('.fixed-table-body').offsetHeight();
console.log(a);
console.log(b);
//$('.fixed-table-body').css({'height':tab-40}); //$('.fixed-table-body').css({'height':tab-40});
//当浏览器窗口变化时,表头与表格不对齐解决 //当浏览器窗口变化时,表头与表格不对齐解决
$('.table').bootstrapTable(); $('.table').bootstrapTable();

Loading…
Cancel
Save