This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
spdocker/themes/spd/source/js/totop.js

14 lines
394 B
JavaScript
Raw Permalink Normal View History

2018-03-07 04:58:54 +00:00
$(window).scroll(function() {
$(window).scrollTop() > $(window).height()*0.5 ? $("#backtotop").addClass("show") : $("#backtotop").removeClass("show");
});
$("#backtotop").click(function() {
$("#backtotop").addClass("launch");
$("html, body").animate({
scrollTop: 0
}, 1000, function() {
$("#backtotop").removeClass("show launch");
});
return false;
});