<style type="text/css">
	#scroll {position:fixed; width:60px; height:20px; right:50px; bottom:50px; display:none; } 
</style>

<script>
$(document).scroll(function() {
	var top = $("#scroll");
	var position = $(window).scrollTop();
  	var height = $(document).height();
	var bottom = height - position;
    
	if(bottom < 1500) {
		top.fadeOut(500);
	} else if(position > 250) {
		top.fadeIn(500);
	} else if(position < 250) {
		top.fadeOut(500);
	}
 });

$("#scroll").click(function() {
	$("html,body").animate({ scrollTop: 0 }, 500);
});
</script>

<span id="scroll">처음으로</span>
블로그 이미지

디츠

“말은 쉽지, 코드를 보여줘.” “Talk is cheap. Show me the code.” – 리누스 토르발스(Linus Torvalds)

,