jQuery-One-Page-Nav

Smooth scrolling and smart navigation when user scrolls on one-page sites.

  • Owner: davist11/jQuery-One-Page-Nav
  • Platform:
  • License:: MIT License
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

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.

The plugin still works even if you add additional content to the page after the fact that changes the position of each section.

Sample Markup:

Example Usage with Defaults:

If you want the hash to change when a user clicks on the navigation, then change the changeHash options to true.

If you want to filter items out of your navigation then pass in a selector to the filter option.

Filter Example:

Offset

In a previous version, there was an offset option to pass into the JavaScript. This was abandoned in favor of a CSS-only solution which simplified the code and makes it easier to handle responsively. Example

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:

Found the solution here

Main metrics

Overview
Name With Ownerdavist11/jQuery-One-Page-Nav
Primary LanguageHTML
Program languageCSS (Language Count: 3)
Platform
License:MIT License
所有者活动
Created At2010-09-26 03:31:51
Pushed At2020-09-16 12:22:56
Last Commit At2017-12-08 15:48:23
Release Count2
Last Release Namev3.0.0 (Posted on 2014-03-07 21:58:15)
First Release Namev2.2.0 (Posted on 2013-04-12 15:24:40)
用户参与
Stargazers Count1.5k
Watchers Count85
Fork Count498
Commits Count43
Has Issues Enabled
Issues Count135
Issue Open Count33
Pull Requests Count2
Pull Requests Open Count17
Pull Requests Close Count22
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private