An open API service indexing awesome lists of open source software.

https://github.com/tinacious/shrinklist

The shrinkList.js plugin does just that, shrinks lists.
https://github.com/tinacious/shrinklist

expand jquery toggle

Last synced: 24 days ago
JSON representation

The shrinkList.js plugin does just that, shrinks lists.

Awesome Lists containing this project

README

          

# shrinkList jQuery plugin

by [Tinacious Design](http://tinaciousdesign.com)

The shrinkList.js plugin does just that, shrinks lists.

This plugin allows you to take a long unordered or ordered list with, for example, 10 items, but only show 5 initially, and create a link for you to show the remaining list items.

View the demo [here](http://tinacious.github.io/shrinkList/).

## Customization

You can customize the following:

1. Amount of items to show initially
2. Speed of the animation in milliseconds
3. Text string that will be clickable to show the rest of the list items

## Implementation

### Include the plugin

Source the plugin file `shrinkList.js` or `shrinkList.min.js`

### Set up your HTML

```html


  • List item

  • List item

  • List item

  • List item

  • List item

  • List item


```

### Call the plugin on document.ready or window.load

```js
$('#my_list').shirnkList({
filterText: 'Show all filters',
filterSpeed: 250,
maxFilters: 3 // default: 10
});
```

### See the Results

Your rendered HTML should look something like this:

```
List item
List item
List item
...
Show all filters
```

[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/tinacious/shrinklist/trend.png)](https://bitdeli.com/free "Bitdeli Badge")