forked from Dogfalo/materialize
-
-
Notifications
You must be signed in to change notification settings - Fork 106
/
Copy pathscrollspy.html
69 lines (57 loc) · 2.31 KB
/
scrollspy.html
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<!doctype html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no">
<title>Documentation - Materialize</title>
<!-- Favicons -->
<link rel="apple-touch-icon-precomposed" href="../../docs/images/favicon/apple-touch-icon-152x152.png">
<meta name="msapplication-TileColor" content="#FFFFFF">
<meta name="msapplication-TileImage" content="images/favicon/mstile-144x144.png">
<link rel="icon" href="../../docs/images/favicon/favicon-32x32.png" sizes="32x32">
<!-- Android 5 Chrome Color -->
<meta name="theme-color" content="#EE6E73">
<link href="../../dist/css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection">
<style>
body, html,
.section {
height: 100%;
}
.table-of-contents li a {
color: #fff;
}
</style>
</head>
<body>
<div id="blue" class="section scrollspy blue"></div>
<div id="green" class="section scrollspy green"></div>
<div id="yellow" class="section scrollspy yellow"></div>
<div id="red" class="section scrollSpy red"></div>
<div class="stats" style="position: fixed; top: 50%; left: 50%; width: 100px; margin-left: -50px;">
<strong>scrollTop: </strong><span id="scrollTop">0</span>
</div>
<div class="wrapper" style="position: fixed; top: 0; right: 0;">
<ul class="section table-of-contents">
<li><a href="#blue">Blue</a></li>
<li><a href="#green">Green</a></li>
<li><a href="#yellow">Yellow</a></li>
<li><a href="#red">Red</a></li>
</ul>
<a id="halfHeights" href="#!" class="btn">Half Heights of Sections</a>
</div>
<!-- Scripts -->
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script src="../../dist/js/materialize.js"></script>
<script type="text/javascript">
$( document ).ready(function() {
$('.scrollspy').scrollSpy({'scrollOffset': 0});
$(window).on('scroll', function() {
$('#scrollTop').text($(window).scrollTop());
});
$('#halfHeights').on('click', function() {
$('.section').css('height', '50%');
});
});
</script>
</body>
</html>