Skip to content

Commit

Permalink
Make the navigation abel to shrink while scrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
thenovacreator committed Sep 9, 2014
1 parent a0305c0 commit 38f9035
Show file tree
Hide file tree
Showing 2 changed files with 268 additions and 200 deletions.
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,32 @@ $('#nav').onePageNav({
filter: ':not(.external)'
});</pre>

### Slim Example:
As soon as the navigation leaves the top of the window the navigation begins to shrink. All you have to do is to specify witch element should be shrinked and witch target values are desired. For the attributes you can use the jquery attribute names
<pre>
&lt;style>
#nav li {
margin: 20px 10px 20px 0px;
}
&lt;/style>

&lt;ul id="nav">
&lt;li class="current">&lt;a href="#section-1">Section 1&lt;/a>&lt;/li>
&lt;li>&lt;a href="#section-2">Section 2&lt;/a>&lt;/li>
&lt;li>&lt;a href="#section-3">Section 3&lt;/a>&lt;/li>
&lt;li>&lt;a href="#section-4">Section 4&lt;/a>&lt;/li>
&lt;li>&lt;a href="#section-5">Section 5&lt;/a>&lt;/li>
&lt;li>&lt;a href="http://google.com" class="external">Some other link&lt;/a>&lt;/li>
&lt;/ul>

$('#nav').onePageNav({
slimItems: "li",
slimAttributes: {
marginTop: "10px",
marginBottom: "10px"
}
});</pre>

### If you are having issues with iOS devices
If clicking a link in the nav makes the rest of the links unclickable until you scroll, you can solve it in this hacky way:

Expand Down
Loading

0 comments on commit 38f9035

Please sign in to comment.