1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00
Sonarr/UI/jQuery/ToTheTop.js

26 lines
630 B
JavaScript
Raw Normal View History

2013-06-25 08:47:56 +03:00
'use strict';
define(
[
'bootstrap'
], function () {
$(document).ready(function () {
2013-06-25 09:27:09 +03:00
var _window = $(window);
var _scrollButton = $('#scroll-up');
2013-06-25 08:47:56 +03:00
$(window).scroll(function () {
2013-06-25 09:27:09 +03:00
if (_window.scrollTop() > 100) {
_scrollButton.fadeIn();
2013-06-25 08:47:56 +03:00
}
else {
2013-06-25 09:27:09 +03:00
_scrollButton.fadeOut();
2013-06-25 08:47:56 +03:00
}
});
2013-06-25 09:27:09 +03:00
_scrollButton.click(function () {
2013-06-25 08:47:56 +03:00
$("html, body").animate({ scrollTop: 0 }, 600);
return false;
});
});
});