I am trying to find a jQuery solution to show the first 3 items on each menu in a left-hand navigation filter with a ‘Show more’ and ‘Show less’ link enabling users to expand the list.
I have searched for a solution but most expand/collapse scripts completely hide the layer whilst others show an Expand (Show more) link but do not toggle to show a Collapse (Show less) link.
My menus are coded as follows.
<div id="menu1">
<ul class="term-list">
<li class="term-item ">Item 1</li>
<li class="term-item ">Item 2</li>
<li class="term-item ">Item 3</li>
<li class="term-item ">Item 4</li>
</ul>
</div>
<div id="menu2">
<ul class="term-list">
<li class="term-item ">Item 1</li>
<li class="term-item ">Item 2</li>
<li class="term-item ">Item 3</li>
<li class="term-item ">Item 4</li>
</ul>
</div>
jsBin demo
Here is just a basic example:
Or a more compact version.