Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/component/more
Expand and collapse lists
https://github.com/component/more
Last synced: 13 days ago
JSON representation
Expand and collapse lists
- Host: GitHub
- URL: https://github.com/component/more
- Owner: component
- Created: 2012-09-11T18:50:32.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2013-10-09T23:41:32.000Z (about 11 years ago)
- Last Synced: 2024-05-08T17:07:07.056Z (8 months ago)
- Language: JavaScript
- Size: 102 KB
- Stars: 6
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# more
Expand and collapse lists.
![](http://f.cl.ly/items/1l1B2I2H3x2h1b1C2E2K/Screen%20Shot%202012-09-11%20at%2011.47.46%20AM.png)
## Installation
$ component install component/more
## Example
```js
var more = require('more');
var list = document.querySelector('ul');more(list)
.max(5)
.more('Show more')
.less('Show less')
.render();
```## API
### More#max(n)
Change max number of list items shown when collapsed, defaults to `5`.
### More#more(label)
Change `label` from default of "More".
### More#less(label)
Change `label` from default of "Less".
### More#render()
Render the list, adds the appropriate more / less link
depending on the state.### More#expand()
Expand the list and re-render.
### More#collapse()
Collapse the list and re-render.
### More#state
String representing the state. Either "expanded", or "collapsed".
# License
MIT