1.20.0 • Published 6 years ago

fws-scrollnav v1.20.0

Weekly downloads
4
License
MIT
Repository
-
Last release
6 years ago

Scroll-Nav

This module searches website content for headings and creates an ordered list to provide within-page navigation links. The module makes no stylistic assumptions; you'll have to bring your own CSS. This code is based on scrollnav by jimmynotjim.

Development

To ease development we use npm scripts to compile JS with browserify/watchify:

First, install the project dependencies:

npm install

To quickly build the project and watch files for changes during development:

npm run watchify

To build a production ready version of the app use:

npm run build

To visualize packages contributing to bundle file size:

npm run inspect:bundle

Options

  • headingTag (string): The HTML tag used to generate the scroll nav list (default: 'h2')
  • content (selector or DOM node): The content area that should be searched for heading tags (default: document.body)
  • target (selector or DOM node): The location where the scroll nav list should be appended (default: document.body)
  • fixedClass (string): The class appended to the nav as it begins to scroll out of view (default: 'fixed'),
  • fixedMargin (integer): The top dimension offset used to determine when to append the 'fixed' class (default: 40),
  • offset (integer): How much top margin is left when scrolling to a heading (default: 40)

License

This project is based on scrollnav by jimmynotjim, which carries an MIT License.

1.20.0

6 years ago

1.19.0

7 years ago

1.18.0

7 years ago

1.17.0

7 years ago

1.16.0

7 years ago

1.15.0

7 years ago

1.14.0

7 years ago

1.13.0

7 years ago

1.12.0

7 years ago

1.11.4

7 years ago

1.11.3

7 years ago

1.11.2

7 years ago

1.11.1

7 years ago

1.11.0

7 years ago

1.10.0

7 years ago

1.9.2

7 years ago

1.9.1

7 years ago

1.9.0

7 years ago

1.8.1

7 years ago

1.8.0

7 years ago

1.7.0

7 years ago

1.6.0

8 years ago

1.5.0

8 years ago

1.4.0

8 years ago

1.3.0

8 years ago

1.2.0

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago