new
This commit is contained in:
Vendored
+7
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+22
@@ -0,0 +1,22 @@
|
||||
var SCROLL_SPEED = 400;
|
||||
|
||||
var ready = function(callback) {
|
||||
if (document.readyState != "loading") callback();
|
||||
else document.addEventListener("DOMContentLoaded", callback);
|
||||
}
|
||||
|
||||
ready(function() {
|
||||
jQuery(window).scroll(function() {
|
||||
if (jQuery(this).scrollTop() > 50) {
|
||||
jQuery('#back-to-top').fadeIn();
|
||||
} else {
|
||||
jQuery('#back-to-top').fadeOut();
|
||||
}
|
||||
});
|
||||
jQuery('#back-to-top').click(function() {
|
||||
jQuery('body,html').animate({
|
||||
scrollTop: 0
|
||||
}, SCROLL_SPEED);
|
||||
return false;
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user