
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
menu-breaker
Advanced tools
First, install the library in your project by npm:
$ npm install menu-breaker
Or Yarn:
$ yarn add menu-breaker
You can also connect script via one of CDNs:
bundle.run: https://bundle.run/menu-breaker
jsDelivr: https://cdn.jsdelivr.net/npm/menu-breaker/
unpkg: https://unpkg.com/menu-breaker/
Connect libary with project using script tag in HTML:
<script src="/path/to/menu-breaker.js"></script>
ES6 import:
import MenuBreaker from 'menu-breaker';
Or CommonJS:
const MenuBreaker = require('menu-breaker');
Next use library with:
• Vanilla JavaScript e.g:
const elem = document.querySelector('.desktop');
const menuBreaker = new MenuBreaker({
element: elem,
settings: {
// options...
},
callbacks: {
// callbacks...
}
});
• or jQuery e.g:
Connect jQuery in HTML
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
or include via command line and CommonJS
$ npm install jquery
$ yarn add jquery
$ bower install jquery
const jQuery = require('jquery');
and call plugin on element
$('.desktop').menuBreaker({
settings: {
// options...
},
callbacks: {
// callbacks...
}
});
| Name | Type | Default | Description | Available options |
|---|---|---|---|---|
| navbar-height | number | 70 | Desktop menu height | e.g: 50, 86, etc. |
| open-class | string | open | Name of the class added to the mobile menu after clicking open or open-close element | Name of class |
| Name | Description | Available options |
|---|---|---|
| onInit | Callback on plugin init | () => { /* code */ } |
| onMenuOpen | Callback on mobile menu open | () => { /* code */ } |
| onMenuClose | Callback on mobile menu close | () => { /* code */ } |
| isMobile | Callback when is mobile menu | () => { /* code */ } |
| isDesktop | Callback when is desktop menu | () => { /* code */ } |
This project is licensed under the MIT License © 2018-present Jakub Biesiada
FAQs
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.