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.
You can customize the following:
- Amount of items to show initially
- Speed of the animation in milliseconds
- Text string that will be clickable to show the rest of the list items
Source the plugin file shrinkList.js or shrinkList.min.js
<ul id="my_list">
<li>List item</li>
<li>List item</li>
<li>List item</li>
<li>List item</li>
<li>List item</li>
<li>List item</li>
</ul>$('#my_list').shirnkList({
filterText: 'Show all filters',
filterSpeed: 250,
maxFilters: 3 // default: 10
});Your rendered HTML should look something like this:
List item
List item
List item
...
Show all filters
