forked from davist11/jQuery-One-Page-Nav
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
76 lines (64 loc) · 2.72 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>jQuery One Page Nav</title>
<link href="demo.css" rel="stylesheet" media="all">
</head>
<body>
<ul id="nav">
<li class="current"><a href="#intro">Intro</a></li>
<li><a href="#usage">Usage</a></li>
<li><a href="#options">Options</a></li>
<li><a href="#examples">Examples</a></li>
</ul>
<div id="container">
<div class="section" id="intro">
<h1>jQuery One Page Nav</h1>
<p>A lightweight jQuery plugin for the navigation on one-page sites. Adds smooth scrolling when clicking on the navigation and automatically selects the correct navigation items as you are scrolling through the different sections.</p>
</div>
<div class="section" id="usage">
<h2>Usage</h2>
<pre>$(document).ready(function() {
$('#nav').onePageNav();
});</pre>
<h3>Markup</h3>
<pre><ul id="nav">
<li class="current"><a href="#intro">Intro</a></li>
<li><a href="#usage">Usage</a></li>
<li><a href="#examples">Examples</a></li>
</ul></pre>
</div>
<div class="section" id="options">
<h2>Options</h2>
<ul>
<li><strong>currentClass</strong>: Class to add to the nav to indicate the current item. Defaults to <em>current</em>.</li>
<li><strong>changeHash</strong>: Whether you want to change the hash when a user clicks on the nav. Defaults to <em>false</em>.</li>
<li><strong>scrollSpeed</strong>: Speed at which the page will scroll upon clicking on the nav. Defaults to <em>750</em>.</li>
<li><strong>scrollThreshold</strong>: Percentage of screen at which the next section should become current. Defaults to <em>0.5</em>.</li>
<li><strong>filter</strong>: Selector of links to filter out of one page nav functionality.</li>
<li><strong>easing</strong>: Easing method. Defaults to <em>swing</em>.</li>
<li><strong>begin</strong>: Function to call when the scrolling starts.</li>
<li><strong>end</strong>: Function to call when the scrolling ends.</li>
<li><strong>scrollChange</strong>: Function to call when you enter a section. The current nav item gets passed in.</li>
</ul>
</div>
<div class="section" id="examples">
<h2>Examples</h2>
<ul>
<li><a href="filter.html">Filter out links</a></li>
<li><a href="hash.html">Change hash</a></li>
<li><a href="top.html">Horizontal Nav</a></li>
</ul>
</div>
</div>
<!--[if lte IE 8]><script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script><![endif]-->
<!--[if gt IE 8]><!--><script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script><!--<![endif]-->
<script src="jquery.nav.js"></script>
<script>
$(document).ready(function() {
$('#nav').onePageNav();
});
</script>
</body>
</html>