gotop.js 278 Bytes
Newer Older
1
$(function(){
Masaru Abe committed
2
	$('#gotop').hide();
3 4

	$(window).scroll(function(){
Masaru Abe committed
5 6
		if ($(this).scrollTop() > 100) {
			$('#gotop').fadeIn();
7
		} else {
Masaru Abe committed
8
			$('#gotop').fadeOut();
9 10 11 12 13
		}
	});

	$('#gotop').click(function(){
		$('body,html').animate({ scrollTop: 0 }, 350);
Masaru Abe committed
14
		return false;
15 16
	});
});