Created
November 26, 2012 01:25
-
-
Save outman/4146107 to your computer and use it in GitHub Desktop.
back to top
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
$("#back-top").hide(); | |
$(function () { | |
$(window).scroll(function () { | |
if ($(this).scrollTop() > 100) { | |
$('#back-top').fadeIn(); | |
} else { | |
$('#back-top').fadeOut(); | |
} | |
}); | |
$('#back-top a').click(function () { | |
$('body,html').animate({ | |
scrollTop: 0 | |
}, 800); | |
return false; | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment