# auto-collapse

> jQuery plugin to automatically collapse menus

Latest version **0.1.0** (published 2015-12-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install auto-collapse
pnpm add auto-collapse
yarn add auto-collapse
bun add auto-collapse
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2015-12-10 |
| First published | 2015-12-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | GestiXi |
| Maintainers | nicolasbadia |
| Keywords | auto, collapse, menu, mobile, desktop, bootstrap |

## Links

- npm: https://www.npmjs.com/package/auto-collapse
- Repository: https://github.com/gestixi/auto-collapse
- Homepage: https://github.com/gestixi/auto-collapse#readme
- Issues: https://github.com/gestixi/auto-collapse/issues
- npm.io page: https://npm.io/package/auto-collapse

## Alternatives

- [@sveltejs/kit](https://npm.io/package/@sveltejs/kit.md) — 2.2M weekly downloads
- [@tangle-network/brand](https://npm.io/package/@tangle-network/brand.md) — 10.0K weekly downloads
- [seneca](https://npm.io/package/seneca.md) — 7.4K weekly downloads
- [@bsb/base](https://npm.io/package/@bsb/base.md) — 7.2K weekly downloads
- [@modern-js/plugin-swc](https://npm.io/package/@modern-js/plugin-swc.md) — 3.4K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2015-12-10

## README

Auto Collapse
=============

jQuery plugin to automatically collapse menus.


------

## Installation

Auto Collapse depends on jQuery. To use it, include this in your page :

    <script src="jquery.js" type="text/javascript"></script>
    <script src="auto-collapse.js" type="text/javascript"></script>


------

## Usage

When you call the plugin for the first time, it will check if the class `normalClass`, which is by default 'navbar-normal', is present on the element to determine if the menu is collapsed or not.

Each time the window is resized, the plugin will check if the menu can fit on one line. If not it will apply the `responsiveClass`, which is by default 'navbar-responsive'. It will also search for links matching the `dropdownLinkSelector`, which is by default '.dropdown > a', and make them dropdown menus.

Here is how you can call the plugin:

    $(function() {
      $('.navbar').autoCollapse();
    });


------

## Options


### normalClass *{string}*

Class to apply when the menu is not collapsed.


### responsiveClass *{string}*

Class to apply when the menu is collapsed.


### dropdownLinkSelector *{string}*

Selector to use to find dropdown links in the menu.


### updateOnResize  *{boolean}*

Set to false if you want to handle yourself when to check if the menu should be collapsed.


------

## Author

**Nicolas Badia**

+ [https://twitter.com/@nicolas_badia](https://twitter.com/@nicolas_badia)
+ [https://github.com/nicolasbadia](https://github.com/nicolasbadia)

------

## Copyright and license

Copyright 2013-2015 GestiXi under [The MIT License (MIT)](LICENSE).

---
_Source: https://npm.io/package/auto-collapse · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
