效果
实现过程
HTML代码
<style>
.custom-scrollbar {
position: fixed;
/*bottom: 0px;*/
height: 20px;
width: 97.5%;
overflow-y: scroll;
overflow-x: scroll;
z-index: 100;
}
#scrollDivTable{
height: 20px;
}
/*原滚动条不显示*/
/*.fixed-table-body::-webkit-scrollbar {*/
/* display: none;*/
/*}*/
</style>
<div id="scrollDiv" class="custom-scrollbar">
<div id="scrollDivTable"></div>
</div>
JS代码
在对于JS文件中的 var table = $("#table"); 下方添加如下代码: