{"id":25457350,"url":"https://github.com/jhammann/jquery-navscroll","last_synced_at":"2025-11-02T12:30:30.837Z","repository":{"id":24772418,"uuid":"28185804","full_name":"jhammann/jquery-navScroll","owner":"jhammann","description":"📜  A simple jQuery plugin for animated scrolling to a section of your page, with scrollspy and mobile dropdown support.","archived":false,"fork":false,"pushed_at":"2018-05-03T07:44:44.000Z","size":19,"stargazers_count":27,"open_issues_count":1,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-18T02:17:04.336Z","etag":null,"topics":["animated","javascript","jquery","navigation","scroll","scrollspy"],"latest_commit_sha":null,"homepage":"https://jhammann.github.io/jquery-navScroll/demo/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jhammann.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-MIT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-18T14:04:10.000Z","updated_at":"2021-04-05T10:56:25.000Z","dependencies_parsed_at":"2022-08-06T04:15:24.129Z","dependency_job_id":null,"html_url":"https://github.com/jhammann/jquery-navScroll","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhammann%2Fjquery-navScroll","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhammann%2Fjquery-navScroll/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhammann%2Fjquery-navScroll/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhammann%2Fjquery-navScroll/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jhammann","download_url":"https://codeload.github.com/jhammann/jquery-navScroll/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239394714,"owners_count":19631122,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["animated","javascript","jquery","navigation","scroll","scrollspy"],"created_at":"2025-02-18T02:17:07.164Z","updated_at":"2025-11-02T12:30:30.792Z","avatar_url":"https://github.com/jhammann.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NavScroll\n\nNavScroll is a simple jQuery plugin for animated scrolling to a section of your page. It also features mobile dropdown support so if your navigation transforms into a dropdown on a certain breakpoint, navScroll hides the dropdown after a click.\n\n## Demo\n\nThere's a demo included with this package. It's an example of navigation I use a lot, so feel free to use it yourself! \u003cbr\u003e\nYou can also checkout the demo here: [jhammann.github.io/jquery-navScroll/demo/](http://jhammann.github.io/jquery-navScroll/demo/)\n\n## Setup\n\nInclude a recent version of jQuery and the navScroll plugin inside your page.\n\n```html\n\u003cscript src=\"http://code.jquery.com/jquery-1.11.0.min.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"jquery.navScroll.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n  // To attach navScroll to an element without mobile dropdown support\n  $('.nav').navScroll();\n\n  // Or you can enable mobile dropdown support and give it a custom breakpoint (defaults to 1024)\n  $('.nav').navScroll({\n    mobileDropdown: true,\n    mobileBreakpoint: 768\n  });\n\u003c/script\u003e\n```\n\n#### Install\nYou can install jquery-navScroll with NPM:\n\n```shell\nnpm install jquery-nav-scroll -S\n```\n\nYou can also use a CDN:\n\n```\nhttps://unpkg.com/jquery-nav-scroll/jquery.navScroll.min.js\n```\n\n\n## Options\n\n| Name | Description | Type | Default |\n|------|-------------|------|---------|\n| `scrollTime` | The time it takes to scroll to the element in milliseconds (set this to 0 so it obviously won't show an animation). | Integer | 500 |\n| `navItemClassName` | The class of the items which invokes the scroll animation. All anchor tags inside the element are clickable when the value is empty. | String | '' |\n| `navHeight` | Set the height of the navigation (to use as offset). 'auto' let's the plugin determine the height automatically, a number determines the height in px. | Integer or String | 'auto' |\n| `mobileDropdown` | If your navigation hides and is used as a dropdown on small screens setting this to true hides the dropdown after a click. | Boolean | false |\n| `mobileDropdownClassName` | Additionaly you can insert the mobile nav's classname here, when left empty the plugin searches for a `\u003cul\u003e` in the same parent element. | String | '' |\n| `mobileBreakpoint` | The 'mobile' breakpoint (like the max-width of a media query). It's recommended that you check this if you use mobile dropdown support. | Integer | 1024 |\n| `scrollSpy` | Set to true if you want to enable the scrollspy, it adds an active class to the nav items when you scroll past their sections. | Boolean | false |\n| `activeParent` | Set to true if you want the parent of the anchor to have an active class instead of the anchor itself (only if ScrollSpy is enabled). | Boolean | false |\n| `activeClassName` | Set the name of the active class when using ScrollSpy. | String | 'active' |\n\n#### Specific scrollTime\n\nThe scrollTime option is for all `\u003ca\u003e` tags inside the element on which navScroll is called. If you want different scrollTimes for different anchors you have to include the data-attribute `data-scrolltime`. The value should be a number. The 'Section 3' URL in the [demo](http://jhammann.github.io/jquery-navScroll/demo/) is an example of this.\n\n## Callbacks\n\n| Name | Description | Type |\n|------|-------------|------|\n| `onScrollStart` | Callback function, will be executed when the scrolling animation starts. | Function |\n| `onScrollEnd` | Callback function, will be executed when the scrolling animations ends. | Function |\n\n```js\n$('.nav').navScroll({\n  onScrollStart: function() {\n    // Execute code when the scrolling starts.\n  },\n  onScrollEnd: function() {\n    // Execute code when the scrolling ends.\n  }\n});\n```\n\n## Changelog\n\n#### Version 1.4.1\n* Added package.json\n\n#### Version 1.4.0\n* Added the `onScrollStart` and `onScrollEnd` callback functions.\n\n#### Version 1.3.1\n\n* Added the `activeClassName` option. This makes it possible to change the class name the plugin gives to an active item when using ScrollSpy.\n\n#### Version 1.3.0\n\n* Added the `activeParent` option. When set to true it gives the parent of the anchor an active class when using ScrollSpy instead of the anchor itself.\n* [Bugfix] Navigations with ScrollSpy enabled also support non-anchor URL's.\n\n#### Version 1.2.1\n\n* [Bugfix] ScrollSpy also works in IE. Added support for an older doctype.\n* Changed some styling for the demo.\n\n#### Version 1.2.0\n\n* Added the option to enable scrollSpy which gives nav items an *active* class when you scroll past their sections.\n\n#### Version 1.1.1\n\n* [Bugfix] Clicking on `\u003ca\u003e` tags without a leading `#` in the href attribute now navigates you to the actual path and won't return an error.\n\n#### Version 1.1.0\n\n* Added support for the scrollTime data attribute.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhammann%2Fjquery-navscroll","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjhammann%2Fjquery-navscroll","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhammann%2Fjquery-navscroll/lists"}