2022-10-25 14:26:44 +03:00
|
|
|
/**
|
|
|
|
* Reference: https://bootsnipp.com/snippets/featured/link-to-top-page
|
|
|
|
*/
|
2019-09-30 15:38:41 +03:00
|
|
|
$(function() {
|
2023-02-14 23:53:40 +03:00
|
|
|
$(window).on('scroll',() => {
|
2022-10-25 14:26:44 +03:00
|
|
|
if ($(this).scrollTop() > 50 &&
|
|
|
|
$("#sidebar-trigger").css("display") === "none") {
|
|
|
|
$("#back-to-top").fadeIn();
|
|
|
|
} else {
|
|
|
|
$("#back-to-top").fadeOut();
|
|
|
|
}
|
|
|
|
});
|
2020-12-10 14:49:43 +03:00
|
|
|
|
2023-02-14 23:53:40 +03:00
|
|
|
$("#back-to-top").on('click',() => {
|
2022-10-25 14:26:44 +03:00
|
|
|
$("body,html").animate({
|
|
|
|
scrollTop: 0
|
|
|
|
}, 800);
|
|
|
|
return false;
|
|
|
|
});
|
2020-12-10 14:49:43 +03:00
|
|
|
});
|