<div class="container">
	<p>Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. Please scroll down. </p>
	<div class="pagetop"><a href="#" id="pagetop_link">ページのトップに戻る</a></div>
</div>
body {
	font-size: 14px;
	line-height: 1.5;
	color: #333;
}
a {
	text-decoration: none;
	color: #333;
}
img {
	vertical-align: bottom;
}
.clearfix {
	display: table;
	clear: both;
}
.container {
	width: 400px;
	margin: 0 auto;
	padding: 50px 0;
	background: #fff;
}
.pagetop {
	margin-top: 20px;
	text-align: right;
	a {
		font-size: 16px;
		font-weight: bold;
		text-decoration: underline;

		&:hover {
			text-decoration: none;
		}
	}
}
(function() {
	'use strict';
	
	var pageTopLink;
	pageTopLink = document.getElementById('pagetop_link');
	
	function pageTop() {
		var scroll;
		
		// スクロール量を取得
		scroll = document.body.scrollTop || document.documentElement.scrollTop;
		
		if(scroll) {
			// y座標へスクロール
			// scrollTo(x, y);
			scrollTo(0, scroll/=1.05);
			/* console.log(scroll); */
			setTimeout(pageTop, 5);
		}
	}
	
	// ページのトップに戻るをクリックした時pageTop関数を実行
	pageTopLink.addEventListener('click', function(e) {
		e.preventDefault();
		pageTop();
	});
}());

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.