: How to detect table that have overflow when reach bottom [jQuery]举表溢出事件
我变得疯狂,重新设计的用户界面与overflow样式表(坏前端)。这个引导示例给了我良好的用户界面,但我没有找到元素来检测滚动事件时,达到底部行。
例子:提前http://jsfiddle.net/andrefadila/vbcwbz5m/2/
感谢
: How to detect table that have overflow when reach bottom [jQuery]举表溢出事件
我变得疯狂,重新设计的用户界面与overflow样式表(坏前端)。这个引导示例给了我良好的用户界面,但我没有找到元素来检测滚动事件时,达到底部行。
例子:提前http://jsfiddle.net/andrefadila/vbcwbz5m/2/
感谢
我相信是scroll事件的结合,与类.fixed-table-body
元素的问题,不存在,直到引导表有完成渲染。
为了解决这个问题,在引导表的post标题事件触发时绑定滚动事件。
$("table").on("post-header.bs.table",function() {
$("#console").append("<div>hello</div>");
$('.fixed-table-body').unbind().on("scroll", function() {
$("#console").append("<div>hello</div>");
});
});
尝试用下面这样的jQuery它会帮助你。
$("table").on("post-header.bs.table",function() {
$('.fixed-table-body').on("scroll", function() {
if($(this).scrollTop() + $(this).innerHeight()>=$(this)[0].scrollHeight)
{
alert('end reached');
}
});
});
我知道这是@Valeklosse首先给出的想法之后的正确代码。不管怎么说,还是要谢谢你。 – andrefadila
不客气 –
你能告诉我你怎么知道'post-header.bs.table'元素?无论如何谢谢师父! – andrefadila
@andrefadila查看http://bootstrap-table.wenzhixin.net.cn/documentation/#events上的文档中的事件我最初认为它可能是post-body.bs.table事件,但事实证明标题是正确的。 – Valeklosse