Skip to content

Commit 6b383d4

Browse files
committed
Fixed scroll to body might not animate
1 parent e642494 commit 6b383d4

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

public/js/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ function scrollToTop() {
759759
scrollTop: 0
760760
}, 100, "linear");
761761
} else {
762-
$(document.body).animate({
762+
$('body, html').stop(true, true).animate({
763763
scrollTop: 0
764764
}, 100, "linear");
765765
}
@@ -776,7 +776,7 @@ function scrollToBottom() {
776776
scrollTop: ui.area.view[0].scrollHeight
777777
}, 100, "linear");
778778
} else {
779-
$(document.body).animate({
779+
$('body, html').stop(true, true).animate({
780780
scrollTop: $(document.body)[0].scrollHeight
781781
}, 100, "linear");
782782
}

public/js/pretty.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@ $(document).ready(function () {
6969
});
7070

7171
function scrollToTop() {
72-
$(document.body).animate({
72+
$('body, html').stop(true, true).animate({
7373
scrollTop: 0
7474
}, 100, "linear");
7575
}
7676

7777
function scrollToBottom() {
78-
$(document.body).animate({
78+
$('body, html').stop(true, true).animate({
7979
scrollTop: $(document.body)[0].scrollHeight
8080
}, 100, "linear");
8181
}

0 commit comments

Comments
 (0)