【发布时间】:2015-07-30 02:12:00
【问题描述】:
当用户滚动到底部时,我正在使用检测滚动位置的标准方法来启用按钮。在您缩小之前,它可以在 100% 缩放时正常工作。
http://jsfiddle.net/ruslans/94qmk4t6/(尝试缩小到 90%/75%)
function ViewModel() {
this.scrolledToBottom = ko.observable(false);
this.onScroll = function (data, event) {
var el = event.target,
$el = $(el),
scrollPosition = $el.scrollTop() + $el.innerHeight();
if ($el.scrollTop() === 0) return;
this.scrolledToBottom(scrollPosition >= (el.scrollHeight));
};
}
我可以使用一个巧妙的解决方法吗?
【问题讨论】:
标签: javascript jquery twitter-bootstrap google-chrome