mirror of
https://github.com/flysnow-org/maupassant-hugo.git
synced 2026-08-24 15:28:55 +00:00
13 lines
358 B
JavaScript
13 lines
358 B
JavaScript
$(window).scroll(function() {
|
|
$(window).scrollTop() > 500 ? $("#rocket").addClass("show") : $("#rocket").removeClass("show");
|
|
});
|
|
$("#rocket").click(function() {
|
|
$("#rocket").addClass("launch");
|
|
$("html, body").animate({
|
|
scrollTop: 0
|
|
}, 500, function() {
|
|
$("#rocket").removeClass("show launch");
|
|
});
|
|
return false;
|
|
});
|