テーブルがあり、overflow : auto; を実行してスクロール可能にしました。ページの読み込み時に非表示になっていた次の 5 行を表示できるように、垂直スクロール バーが一番下に達したかどうかを知りたいです。インターネットを検索したところはどこでもwindow.height()を使用しています....しかし、要素がiframe内のテーブルに制限されているため、windowを使用する必要はありません。
ここにテーブル構造があります
<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();
}
});
});