GitXplorerGitXplorer
n

metroline.js

public
1 stars
0 forks
1 issues

Commits

List of commits on branch master.
Unverified
2f9a6d46010ca4b52e604f2751f2c35bbeba03f0

Update README.md

nnkcr committed 9 years ago
Unverified
b703e9eaa342473f3fd1493316c1b4bf76dccc68

Update README.md

nnkcr committed 9 years ago
Unverified
7cc61d294de5c876b3d55e1afafaeb51d371a551

Update README.md

nnkcr committed 9 years ago
Unverified
9fdbc5eb66b50122206fb10670a8d5722aee9be8

Readme update

nnkcr committed 9 years ago
Unverified
8be6965058127fea9cfd05130f65b33c774c8bb3

Nom package, version 0.1.2 with code cleaning

nnkcr committed 9 years ago
Unverified
42ac20d72f999dd5ff19965808cfefd2e58c4fee

changed name to min.js

nnkcr committed 9 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