mirror of
https://git.yylx.win/https://github.com/mojiro/OneExperienceKB.git
synced 2025-10-03 18:01:08 +08:00
18 lines
358 B
JavaScript
18 lines
358 B
JavaScript
$(window).scroll(function() {
|
|
var height = $(window).scrollTop();
|
|
|
|
if (height > 200) {
|
|
$('#backToTop').fadeIn();
|
|
}
|
|
else {
|
|
$('#backToTop').fadeOut();
|
|
}
|
|
});
|
|
|
|
$(document).ready(function() {
|
|
$("#backToTop").click(function(event) {
|
|
event.preventDefault();
|
|
$("html, body").animate({ scrollTop: 0 }, "slow");
|
|
return false;
|
|
});
|
|
});
|