GitXplorerGitXplorer
n

metroline.js

public
1 stars
0 forks
1 issues

Commits

List of commits on branch master.
Unverified
3e4b44bafde1d337250296e5e3458e400214db0e

v0.1.1

nnkcr committed 9 years ago
Unverified
a566ac71b67656411020a4edd1b3036b257228e5

v0.1.0

nnkcr committed 9 years ago
Unverified
fd2dc0ec85ac514bb70c44aa9cd74b6095ac12d1

v0.0.4

nnkcr committed 10 years ago
Unverified
c834aa8bbd16f67a7e1ce961b9d58613e84b3a4b

Update README.md

nnkcr committed 10 years ago
Unverified
9579097f7d7284b4bafa01b2b1352af84cc3f608

v0.0.3

nnkcr committed 10 years ago
Unverified
3962fca78986aa5a68e59a0e654d6b14920e4017

version 0.0.2

nnkcr committed 10 years ago

README

The README file for this repository.

Metroline

Add a line containing links to your sections. The line acts as a scrollbar.


img

Prerequiste

Javascript :
Use Jquery

CSS:

html,body {
  height: 100%;
}

Install

npm install metroline.js

OR

Get the javascript and css (or scss) files from the dist folder and include them.

Set up

In your html, add after the body tag :

<div id="scrollbar">
  <div id="scrollcursor">
  </div>
  <ul id="scrolllinks">
  </ul>
</div>

Then you need a section for each link. A section must have an id and the link's title :

<section data-title="Link1 title" id="Link1" class="fixed">
...
</section>
<section data-title="Link2 title" id="Link2" class="scrolling">
...
</section>

Finally, fire the javascript :

$(window).load(function(){ new Metroline(); });

Note For best style, it assumes you have at least the following css reset :

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

ul,li {
	list-style-type: none;
}

Changelog

v0.1.2

Code cleaning

v0.1.1

Fixed bug wrongly displaying titles in some cases

v0.1.0

Handle window resize. Some code refactoring

v0.0.4

Take care that there is no links already present when adding links.

v0.0.3

Fixed a style bug with the first link. Now javascript automatically add "active" class for the first <li>...</li>

v0.0.2

Changed the way links switch style when scrolled. Now use a class "active" instead of manually apply style via javascript.

v0.0.1

First release