的底部我有一個表,我做到了滾動做溢出:汽車; 現在我想知道垂直滾動條是否到達底部,這樣我就可以顯示下一個5頁的頁面加載時隱藏的行。 哪裏我在網上搜索它使用window.height()....但我不需要使用窗口,因爲我的元素被限制在iframe中的表。如何知道我到臺
這裏是表結構
<div class="responsive" style="height:150px; overflow:hidden;" >
<table class="responsive table table-bordered dataTable" id="checkAllEmail" >
<thead>
<tr style="display:block;">
<th class="serial" style="width:57px;">#</th>
<th style="width:156px;">Display Name</th>
<th class="tableButton" style=" text-align:center!important; width:147px;">Actions</th>
</tr>
</thead>
<tbody id="mailServerTbody" style="height:113px; overflow:auto; display:block;">
</tbody>
</table>
</div>
這裏就是我試圖在JS做
$(document).ready(function(){
var div=0;
$('#mailServerTbody').scroll(function(){
var temp = $(this).scrollTop();
console.log($("#mailServerTbody").position().top+"blah")
console.log(temp)
if((temp%32==0)||(temp%32==17)){
console.log("enter")
div = div+4;
//div = div*5-1;
console.log(temp/32+"temp")
$('#mailServerTbody tr:gt('+div+'):lt(5)').show();
}
});
});
$( 「#mailServerTbody」)[0 ] .scrollHeight –
試$( 「#mailServerTbody表:最後的」),或者找到更多的http://stackoverflow.com/questions/9979418/how-to-find-last-child -of-特定型表使用,jquery的 – anshuVersatile
@ WillemD'haeseleer'document.querySelector( '#mailServerTbody')。scrollHeight' – hitautodestruct