gotop.js 278 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
$(function(){
	$('#gotop').hide();

	$(window).scroll(function(){
		if ($(this).scrollTop() > 100) {
			$('#gotop').fadeIn();
		} else {
			$('#gotop').fadeOut();
		}
	});

	$('#gotop').click(function(){
		$('body,html').animate({ scrollTop: 0 }, 350);
		return false;
	});
});