Javascript 在引导表上使用slimscroll的正确方法是什么?
我试图在HTML表上使用slim scroll,但我根本没有得到任何滚动。以下是我尝试过的代码:- 表格代码:-Javascript 在引导表上使用slimscroll的正确方法是什么?,javascript,html,twitter-bootstrap,jquery-plugins,slimscroll,Javascript,Html,Twitter Bootstrap,Jquery Plugins,Slimscroll,我试图在HTML表上使用slim scroll,但我根本没有得到任何滚动。以下是我尝试过的代码:- 表格代码:- <div class"container"> <div class="row"> <div class="col-md-8"> <div class="scrolltable"> <table class="table table-striped table-bordered text-center table-condens
<div class"container">
<div class="row">
<div class="col-md-8">
<div class="scrolltable">
<table class="table table-striped table-bordered text-center table-condensed"> <thead>
<tr style="height: 83px;">
<th style="width: 249px; height: 83px;"> STUDENT-ID</th>
<th style="width: 34px; height: 83px;"> S.NO</th>
<th style="width: 198px; height: 83px;"> STUDENT NAME</th>
</tr>
</thead>
<tbody id="bodyer">
<tr style="height: 23px;">
<td style="width: 249px; height: 23px;">15-14-065</td>
<td style="width: 34px; height: 23px;">1</td>
<td style="width: 198px; height: 23px;">Anisul Islam</td>
<td style="width: 11px; height: 23px;">L</td>
<td style="width: 11px; height: 23px;">U</td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 12px; height: 23px;"> </td>
<td style="width: 12px; height: 23px;"> </td>
<td style="width: 12px; height: 23px;"> </td>
<td style="width: 13px; height: 23px;"> </td>
<td style="width: 13px; height: 23px;"> </td>
</tr>
<tr style="height: 23px;">
<td style="width: 249px; height: 23px;"> </td>
<td style="width: 34px; height: 23px;"> </td>
<td style="width: 198px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 12px; height: 23px;"> </td>
<td style="width: 12px; height: 23px;"> </td>
<td style="width: 12px; height: 23px;"> </td>
<td style="width: 13px; height: 23px;"> </td>
<td style="width: 13px; height: 23px;"> </td>
</tr>
<tr style="height: 23px;">
<td style="width: 249px; height: 23px;"> </td>
<td style="width: 34px; height: 23px;"> </td>
<td style="width: 198px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 11px; height: 23px;"> </td>
<td style="width: 12px; height: 23px;"> </td>
<td style="width: 12px; height: 23px;"> </td>
<td style="width: 12px; height: 23px;"> </td>
<td style="width: 13px; height: 23px;"> </td>
<td style="width: 13px; height: 23px;"> </td>
</tr>
</tbody>
</table></div></div></div></div>
学生证
序号
学名
15-14-065
1.
异教徒伊斯兰教
L
U
我从这里读到了答案:-
但这似乎没有帮助。
下面是javascript,我试图在其中为表使用slim scroll:-
<script>
$(function(){
$('.scrolltable').slimScroll({
height: '50px'
});
});
</script>
$(函数(){
$('.scrolltable').slimScroll({
高度:'50px'
});
});
我也试过:-
<script>
$(function(){
$('#bodyer').slimScroll({
height: '50px'
});
});
</script>
$(函数(){
$(“#bodyer”).slimScroll({
高度:'50px'
});
});
您的脚本无法运行有两个原因:
- 1) 您需要在“table”标记中添加以下属性:
<table class="table table-striped table-bordered text-center table-condensed" data-toggle="table" data-cache="false" data-height="299">
$(document).ready(function () {
$('.fixed-table-body').slimScroll({});
});