forked from lukehaas/Scrollify
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index-2.html
125 lines (114 loc) · 5.61 KB
/
index-2.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Bootstrap 101 Template</title>
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<link href="css/custom.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body data-spy="scroll" data-target="#nav_indicators">
<section class="panel home" id="home">
<div class="inner">
<div class="vertical-center">
<h1>Pagination</h1>
<p>Simple navigation for Scrollify sections.</p>
</div>
</div>
</section>
<section class="panel panel1" id="second">
<div class="inner">
<div class="vertical-center">
<h2>afterRender()</h2>
<p>Use Scrollify's <span class="code">afterRender()</span> callback to build your pagination links.</p>
</div>
</div>
</section>
<section class="panel panel2" id="third">
<div class="inner">
<div class="vertical-center">
<h2>before()</h2>
<p>Apply an active class with the <span class="code">before()</span> callback.</p>
</div>
</div>
</section>
<section class="panel panel3" id="fourth">
<div class="inner">
<div class="vertical-center">
<h2>move()</h2>
<p>Call <span class="code">$.scrollify.move()</span> in a click event to navigate to sections.</p>
</div>
</div>
</section>
<div class="nav_indicators" id="nav_indicators">
<ul class="nav list-unstyled">
<li><a href="#home"></a></li>
<li><a href="#second"></a></li>
<li><a href="#third"></a></li>
<li><a href="#fourth"></a></li>
</ul>
</div>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
<script type="text/javascript">
function CheckScoller() {
if($('#nav_indicators li:nth-child(2)').hasClass('active')) {
$('#nav_indicators li:first-child').addClass('scrolled');
$('#nav_indicators li:nth-child(2)').removeClass('scrolled');
$('#nav_indicators li:nth-child(3)').removeClass('scrolled');
$('#nav_indicators li:nth-child(4)').removeClass('scrolled');
}
else if($('#nav_indicators li:nth-child(3)').hasClass('active')) {
$('#nav_indicators li:first-child').addClass('scrolled');
$('#nav_indicators li:nth-child(2)').addClass('scrolled');
$('#nav_indicators li:nth-child(3)').removeClass('scrolled');
$('#nav_indicators li:nth-child(4)').removeClass('scrolled');
}
else if($('#nav_indicators li:nth-child(4)').hasClass('active')) {
$('#nav_indicators li:first-child').addClass('scrolled');
$('#nav_indicators li:nth-child(2)').addClass('scrolled');
$('#nav_indicators li:nth-child(3)').addClass('scrolled');
$('#nav_indicators li:nth-child(4)').removeClass('scrolled');
}
};
$('#nav_indicators li:nth-child(2)>a').click(function(){
if($('#nav_indicators li:nth-child(2)').hasClass('active')) {
$('#nav_indicators li:first-child').addClass('scrolled');
$('#nav_indicators li:nth-child(2)').removeClass('scrolled');
$('#nav_indicators li:nth-child(3)').removeClass('scrolled');
$('#nav_indicators li:nth-child(4)').removeClass('scrolled');
}
});
$('#nav_indicators li:nth-child(3)>a').click(function(){
if($('#nav_indicators li:nth-child(3)').hasClass('active')) {
$('#nav_indicators li:first-child').addClass('scrolled');
$('#nav_indicators li:nth-child(2)').addClass('scrolled');
$('#nav_indicators li:nth-child(3)').removeClass('scrolled');
$('#nav_indicators li:nth-child(4)').removeClass('scrolled');
}
});
$('#nav_indicators li:nth-child(4)>a').click(function(){
if($('#nav_indicators li:nth-child(4)').hasClass('active')) {
$('#nav_indicators li:first-child').addClass('scrolled');
$('#nav_indicators li:nth-child(2)').addClass('scrolled');
$('#nav_indicators li:nth-child(3)').addClass('scrolled');
$('#nav_indicators li:nth-child(4)').removeClass('scrolled');
}
});
$(window).load(function(){ CheckScoller(); })
$(window).scroll(function(){ CheckScoller(); })
</script>
</body>
</html>