This commit is contained in:
17
TopTop/js/toptop.js
Normal file
17
TopTop/js/toptop.js
Normal file
@@ -0,0 +1,17 @@
|
||||
$(function () {
|
||||
$(window).scroll(function () {
|
||||
var scroHei = $(window).scrollTop();
|
||||
if (scroHei > 500) {
|
||||
$('.back-to-top').css('top', '-200px');
|
||||
} else {
|
||||
$('.back-to-top').fadeOut();
|
||||
}
|
||||
})
|
||||
$('.back-to-top').click(function () {
|
||||
$('body,html').animate({
|
||||
scrollTop: 0
|
||||
}, 600);
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user