Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Commit

Permalink
Merge pull request #1157 from njam/issue-1157
Browse files Browse the repository at this point in the history
Read scrollHeight from document.body
  • Loading branch information
njam committed Apr 25, 2014
2 parents 348468f + 9db595d commit faa82cb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion client-vendor/after-body/jquery.helpers/jquery.helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,15 @@
},

scrollBottom: function() {
this.scrollTop(this.prop("scrollHeight"));
this.each(function() {
var scrollHeight;
if (this === document) {
scrollHeight = $(document.body).prop('scrollHeight');
} else {
scrollHeight = $(this).prop('scrollHeight');
}
$(this).scrollTop(scrollHeight);
});
},

scrollTo: function(target) {
Expand Down

0 comments on commit faa82cb

Please sign in to comment.