summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorWu Cheng-Han2015-09-25 14:08:02 +0800
committerWu Cheng-Han2015-09-25 14:08:02 +0800
commit6b383d49bb4f19023815804b3da708609adea0c9 (patch)
tree947f3a14976f1f229cf963b0b66cddac13d78917 /public
parente64249453f98c65b632b504e9c71a1c616e875b9 (diff)
Fixed scroll to body might not animate
Diffstat (limited to '')
-rw-r--r--public/js/index.js4
-rw-r--r--public/js/pretty.js4
2 files changed, 4 insertions, 4 deletions
diff --git a/public/js/index.js b/public/js/index.js
index 07082401..dde36cc5 100644
--- a/public/js/index.js
+++ b/public/js/index.js
@@ -759,7 +759,7 @@ function scrollToTop() {
scrollTop: 0
}, 100, "linear");
} else {
- $(document.body).animate({
+ $('body, html').stop(true, true).animate({
scrollTop: 0
}, 100, "linear");
}
@@ -776,7 +776,7 @@ function scrollToBottom() {
scrollTop: ui.area.view[0].scrollHeight
}, 100, "linear");
} else {
- $(document.body).animate({
+ $('body, html').stop(true, true).animate({
scrollTop: $(document.body)[0].scrollHeight
}, 100, "linear");
}
diff --git a/public/js/pretty.js b/public/js/pretty.js
index 6fff4d03..52882e98 100644
--- a/public/js/pretty.js
+++ b/public/js/pretty.js
@@ -69,13 +69,13 @@ $(document).ready(function () {
});
function scrollToTop() {
- $(document.body).animate({
+ $('body, html').stop(true, true).animate({
scrollTop: 0
}, 100, "linear");
}
function scrollToBottom() {
- $(document.body).animate({
+ $('body, html').stop(true, true).animate({
scrollTop: $(document.body)[0].scrollHeight
}, 100, "linear");
} \ No newline at end of file