{"id":18034671,"url":"https://github.com/yuanqing/menu-aim","last_synced_at":"2025-10-04T01:32:02.546Z","repository":{"id":54771319,"uuid":"50781661","full_name":"yuanqing/menu-aim","owner":"yuanqing","description":":dart: Instant mega menus in vanilla JavaScript.","archived":false,"fork":false,"pushed_at":"2021-01-30T07:40:58.000Z","size":84,"stargazers_count":40,"open_issues_count":3,"forks_count":12,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-17T23:40:22.376Z","etag":null,"topics":["javascript","menu","navigation"],"latest_commit_sha":null,"homepage":"https://codepen.io/lyuanqing/pen/paLgwN","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/yuanqing.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-31T15:45:32.000Z","updated_at":"2024-06-11T10:19:18.000Z","dependencies_parsed_at":"2022-08-14T02:20:25.901Z","dependency_job_id":null,"html_url":"https://github.com/yuanqing/menu-aim","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuanqing%2Fmenu-aim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuanqing%2Fmenu-aim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuanqing%2Fmenu-aim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuanqing%2Fmenu-aim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yuanqing","download_url":"https://codeload.github.com/yuanqing/menu-aim/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235208997,"owners_count":18953003,"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":["javascript","menu","navigation"],"created_at":"2024-10-30T11:13:20.854Z","updated_at":"2025-10-04T01:31:57.286Z","avatar_url":"https://github.com/yuanqing.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# menu-aim [![npm Version](http://img.shields.io/npm/v/menu-aim.svg?style=flat)](https://www.npmjs.org/package/menu-aim) [![Build Status](https://img.shields.io/travis/yuanqing/menu-aim.svg?branch=master\u0026style=flat)](https://travis-ci.org/yuanqing/menu-aim)\n\n\u003e [Instant mega menus](http://bjk5.com/post/44698559168/breaking-down-amazons-mega-dropdown) in vanilla JavaScript.\n\n- Keeps a sub-menu open when the mouse is determined to be enroute to it, else instantly switches to another item in the menu\n- 670 bytes gzipped\n\n## API\n\n\u003e [**Editable demo (CodePen)**](https://codepen.io/lyuanqing/pen/paLgwN)\n\n```js\nconst menuAim = require('menu-aim')\n```\n\n### menuAim(element [, options])\n\n`element` is a DOM element and `options`is an optional object literal.\n\n- Returns a \u0026ldquo;clean up\u0026rdquo; function for removing event listeners bound by the function to `element` and `window`.\n\n- `element` has the following HTML structure:\n\n  ```html\n  \u003cul class=\"menu-aim\"\u003e\n    \u003cli class=\"menu-aim__item\"\u003e\n      \u003ca class=\"menu-aim__item-name\"\u003e\u003c!-- ... --\u003e\u003c/a\u003e\n      \u003cul class=\"menu-aim__item-submenu\"\u003e\u003c!-- ... --\u003e\u003c/ul\u003e\n    \u003c/li\u003e\n    \u003c!-- ... --\u003e\n  \u003c/ul\u003e\n  ```\n\n  See the [demo](https://codepen.io/lyuanqing/pen/paLgwN) for the CSS styles required on `element` and the various nested elements.\n\n- Keys on `options`:\n\n  Key | Description | Default\n  :--|:--|:--\n  `menuItemSelector` | Selector for each menu item. | `.menu-aim__item`\n  `menuItemActiveClassName` | Class name assigned to a menu item when it is active. | `menu-aim__item--active`\n  `menuItemSubMenuSelector` | Selector for the sub-menu element nested within each menu item. | `.menu-aim__item-submenu`\n  `delayingClassName` | Class name applied to `element` when some menu item is active and the mouse is determined to be enroute to the active submenu. | `menu-aim--delaying`\n\n## Installation\n\nInstall via [yarn](https://yarnpkg.com):\n\n```sh\n$ yarn add menu-aim\n```\n\nOr [npm](https://npmjs.com):\n\n```sh\n$ npm install --save menu-aim\n```\n\n## Prior art\n\n- [jQuery-menu-aim](https://github.com/kamens/jQuery-menu-aim)\n\n## License\n\n[MIT](LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyuanqing%2Fmenu-aim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyuanqing%2Fmenu-aim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyuanqing%2Fmenu-aim/lists"}