added scroll to top button

This commit is contained in:
kay.one 2013-06-24 22:47:56 -07:00
parent 25581c8051
commit 272cc93bd2
4 changed files with 97 additions and 45 deletions

23
UI/jQuery/ToTheTop.js Normal file
View file

@ -0,0 +1,23 @@
'use strict';
define(
[
'bootstrap'
], function () {
$(document).ready(function () {
$(window).scroll(function () {
if ($(this).scrollTop() > 100) {
$('#scroll-up').fadeIn();
}
else {
$('#scroll-up').fadeOut();
}
});
$('#scroll-up').click(function () {
$("html, body").animate({ scrollTop: 0 }, 600);
return false;
});
});
});