Fixed scroll to body might not animate

This commit is contained in:
Wu Cheng-Han 2015-09-25 14:08:02 +08:00
parent e64249453f
commit 6b383d49bb
2 changed files with 4 additions and 4 deletions

View File

@ -759,7 +759,7 @@ function scrollToTop() {
scrollTop: 0 scrollTop: 0
}, 100, "linear"); }, 100, "linear");
} else { } else {
$(document.body).animate({ $('body, html').stop(true, true).animate({
scrollTop: 0 scrollTop: 0
}, 100, "linear"); }, 100, "linear");
} }
@ -776,7 +776,7 @@ function scrollToBottom() {
scrollTop: ui.area.view[0].scrollHeight scrollTop: ui.area.view[0].scrollHeight
}, 100, "linear"); }, 100, "linear");
} else { } else {
$(document.body).animate({ $('body, html').stop(true, true).animate({
scrollTop: $(document.body)[0].scrollHeight scrollTop: $(document.body)[0].scrollHeight
}, 100, "linear"); }, 100, "linear");
} }

View File

@ -69,13 +69,13 @@ $(document).ready(function () {
}); });
function scrollToTop() { function scrollToTop() {
$(document.body).animate({ $('body, html').stop(true, true).animate({
scrollTop: 0 scrollTop: 0
}, 100, "linear"); }, 100, "linear");
} }
function scrollToBottom() { function scrollToBottom() {
$(document.body).animate({ $('body, html').stop(true, true).animate({
scrollTop: $(document.body)[0].scrollHeight scrollTop: $(document.body)[0].scrollHeight
}, 100, "linear"); }, 100, "linear");
} }