parent
4e5d09e6c5
commit
2fc7caf0bd
1 changed files with 2 additions and 1 deletions
|
|
@ -100,7 +100,8 @@ app.views.InfScroll = app.views.Base.extend({
|
|||
infScroll : function() {
|
||||
var $window = $(window),
|
||||
distFromBottom = $(document).height() - $window.height() - $window.scrollTop(),
|
||||
elementDistance = this.$el.children().last().offset().top - $window.scrollTop() - 500;
|
||||
lastElOffset = this.$el.children().last().offset(),
|
||||
elementDistance = lastElOffset ? lastElOffset.top - $window.scrollTop() - 500 : 1;
|
||||
|
||||
if(elementDistance <= 0 || distFromBottom < 500) {
|
||||
this.trigger("loadMore");
|
||||
|
|
|
|||
Loading…
Reference in a new issue