1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-05 02:22:31 +01:00
Radarr/UI/jQuery/ToTheTop.js

26 lines
630 B
JavaScript
Raw Normal View History

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