{"id":19099371,"url":"https://github.com/gijsroge/priority-navigation","last_synced_at":"2025-05-15T21:03:48.363Z","repository":{"id":31522505,"uuid":"35086968","full_name":"gijsroge/priority-navigation","owner":"gijsroge","description":"Javascript implementation for Priority+ Navigation — no dependencies","archived":false,"fork":false,"pushed_at":"2022-05-25T23:33:07.000Z","size":225,"stargazers_count":769,"open_issues_count":30,"forks_count":108,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-05-10T01:04:17.778Z","etag":null,"topics":["navigation","priority","responsive"],"latest_commit_sha":null,"homepage":"http://gijsroge.github.io/priority-nav.js/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"NodeBB/nodebb-plugin-write-api","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gijsroge.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-05T08:18:54.000Z","updated_at":"2025-05-01T16:18:32.000Z","dependencies_parsed_at":"2022-08-31T04:21:55.497Z","dependency_job_id":null,"html_url":"https://github.com/gijsroge/priority-navigation","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gijsroge%2Fpriority-navigation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gijsroge%2Fpriority-navigation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gijsroge%2Fpriority-navigation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gijsroge%2Fpriority-navigation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gijsroge","download_url":"https://codeload.github.com/gijsroge/priority-navigation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254422754,"owners_count":22068678,"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":["navigation","priority","responsive"],"created_at":"2024-11-09T03:49:47.586Z","updated_at":"2025-05-15T21:03:48.325Z","avatar_url":"https://github.com/gijsroge.png","language":"JavaScript","funding_links":[],"categories":["UI Components"],"sub_categories":["Navbar"],"readme":"# PriorityNavigation.js\nPriorityNav is a pure javascript plugin that will move your menu items if they don't fit its parent.\n#### Vue.js version **[here](https://github.com/gijsroge/vue-responsive-menu)**.\n----------\n![Priority Navigation demo](http://gijsroge.github.io/priority-nav.js/priority-nav-demo.gif)\n\n#### Take a look at the **[Demo](http://gijsroge.github.io/priority-nav.js/)** site.\n\n----------\n\n### Features\n- **Accessible**\u003cbr\u003eAdds appropriate aria attributes and set focus to links when needed.\n- **No dependencies**\u003cbr\u003eThe plugin is written in pure javascript making it fast and lean.\n- **Breakpoint**\u003cbr\u003eWhen the breakpoint has been reached the plugin will automaticly move all items to the dropdown \u0026 change the toggle label to navDropdownBreakpointLabel.\n- **Smart calculation of available space**\u003cbr\u003eIt automatically looks for the main navigation's siblings and calculates remaining space.\n- **Flexible**\u003cbr\u003eBecause of the point above you can have multiple inline-block/flexbox items on the same level.\n- **Non obstructive menu dropdown**\u003cbr\u003eThe dropdown menu can be closed by clicking outside and pressing escape.\n- **Callbacks**\u003cbr\u003eCallbacks are fired when an item is moved or moved back from the main navigation.\n\n### Usage\nLoad plugin files\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chead\u003e\n    \u003clink rel=\"stylesheet\" href=\"priority-nav-core.css\"\u003e\n\u003c/head\u003e\n\n\u003cbody\u003e\n    \u003cscript async src=\"priority-nav.js\"\u003e\u003c/script\u003e\n\u003c/body\u003e\n```\n\nCall plugin without any options.\n```js\nvar nav = priorityNav.init();\n```\nIdeal html structure\n```html\n\u003cnav\u003e\n    \u003cul\u003e \u003c- needs to be inline-block\n        \u003cli\u003emenu item\u003c/li\u003e\n        \u003cli\u003emenu item\u003c/li\u003e\n        \u003cli\u003emenu item\u003c/li\u003e\n        \u003cli\u003emenu item\u003c/li\u003e\n    \u003c/ul\u003e\n\u003c/nav\u003e\n```\n\n### Options\n```js\ninitClass:                  \"js-priorityNav\", // Class that will be printed on html element to allow conditional css styling.\nmainNavWrapper:             \"nav\", // mainnav wrapper selector (must be direct parent from mainNav)\nmainNav:                    \"ul\", // mainnav selector. (must be inline-block)\nnavDropdownClassName:       \"nav__dropdown\", // class used for the dropdown - this is a class name, not a selector.\nnavDropdownToggleClassName: \"nav__dropdown-toggle\", // class used for the dropdown toggle - this is a class name, not a selector.\nnavDropdownLabel:           \"more\", // Text that is used for the dropdown toggle.\nnavDropdownBreakpointLabel: \"menu\", //button label for navDropdownToggle when the breakPoint is reached.\nbreakPoint:                 500, //amount of pixels when all menu items should be moved to dropdown to simulate a mobile menu\nthrottleDelay:              50, // this will throttle the calculating logic on resize because i'm a responsible dev.\noffsetPixels:               0, // increase to decrease the time it takes to move an item.\ncount:                      true, // prints the amount of items are moved to the attribute data-count to style with css counter.\n\n//Callbacks\nmoved: function () {}, // executed when item is moved to dropdown\nmovedBack: function () {} // executed when item is moved back to main menu\n```\n\n### Package managers\n- **npm:** `npm install --save priority-nav`\n- **bower:** `bower install priority-nav.js`\n\n### Building the source files\n```\n#cloning repository\ngit clone https://github.com/gijsroge/priority-navigation.git\ncd priority-navigation\n\n#dependencies\nnpm install\n\n#build files to dist folder\ngrunt build\n```\n\n### IE9 Support\nTo support Internet Explorer 9 and lower [classList.js](https://github.com/remy/polyfills/blob/master/classList.js/) must be added your page.\n\n```html\n\u003c!--[if lt IE 9]\u003e\u003cscript src=\"https://cdnjs.cloudflare.com/ajax/libs/classlist/2014.01.31/classList.min.js\"\u003e\u003c/script\u003e\u003c![endif]--\u003e\n```\n\n### IE8 Support\nTo support Internet Explorer 8, [es5-shim](https://github.com/kriskowal/es5-shim/) and classList.js from above must be added your page.\n\n```html\n\u003c!--[if lt IE 9]\u003e\u003cscript src=\"https://cdnjs.cloudflare.com/ajax/libs/es5-shim/2.0.8/es5-shim.min.js\"\u003e\u003c/script\u003e\u003c![endif]--\u003e\n```\n\n### Alternatives\n* https://github.com/lewie6/ng-priority-nav (angular)\n* https://github.com/matthornsby/priority-navigation (jQuery)\n* https://github.com/352Media/flexMenu (jQuery)\n* https://github.com/VPenkov/okayNav (jQuery)\n* https://github.com/VPenkov/okayNav-vanillaJS (no dependencies)\n* https://github.com/skywalkapps/nav-priority (no dependencies)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgijsroge%2Fpriority-navigation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgijsroge%2Fpriority-navigation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgijsroge%2Fpriority-navigation/lists"}