jQuery-One-Page-Nav

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

  • 所有者: davist11/jQuery-One-Page-Nav
  • 平台:
  • 许可证: MIT License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

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

主要指标

概览
名称与所有者davist11/jQuery-One-Page-Nav
主编程语言HTML
编程语言CSS (语言数: 3)
平台
许可证MIT License
所有者活动
创建于2010-09-26 03:31:51
推送于2020-09-16 12:22:56
最后一次提交2017-12-08 15:48:23
发布数2
最新版本名称v3.0.0 (发布于 2014-03-07 21:58:15)
第一版名称v2.2.0 (发布于 2013-04-12 15:24:40)
用户参与
星数1.5k
关注者数85
派生数498
提交数43
已启用问题?
问题数135
打开的问题数33
拉请求数2
打开的拉请求数17
关闭的拉请求数22
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?