forked from iamdustan/smoothscroll
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-element.html
More file actions
40 lines (36 loc) · 853 Bytes
/
test-element.html
File metadata and controls
40 lines (36 loc) · 853 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<!doctype html>
<html>
<head>
<style>
body {
background: #efefef;
}
.overflow {
background: #fefefe;
box-shadow: inset 0 2px 2px #ddd;
margin: 1.5em auto;
overflow: auto;
padding: 1.5em;
height: 400px;
width: 70%;
}
</style>
</head>
<body>
<div class="overflow">
<h1>Quick and dirty scrollTo(x, y, 'smooth') testing</h1>
<p style='height: 500px'>For real. Really quick. Really dirty.</p>
<p id="scrollMeIn" style='height: 500px'>For real. Really quick. Really dirty.</p>
</div>
<script src="smoothscroll.js"></script>
<script>
var T = 2000;
document.addEventListener('DOMContentLoaded', function(e) {
setTimeout(function() {
console.log('Do the scroll');
document.getElementById('scrollMeIn').scrollIntoView(true, { behavior: 'smooth' });
}, 500);
}, false);
</script>
</body>
</html>