I have a div with ul inside it. ul can contain an unknown number of elements. Each element can contain different amounts of content. It can be long or short lines of text.
Example: http://codepen.io/anon/pen/Augrd
This DIV when the page is loaded should not be more than 100px in height.
What I want to achieve: if inside this DIV is too much content and it is overflowed, then I want to display the link on which the user can click and “open” this DIV making it more in height.
This detects the natural height of your
<div>and automatically generates a “More…” link when the natural height of the<div>is greater than its current height (it does not show one if 100px is enough to show all the contents). You do not have to adjust the javascript for different heights of the<div>.DEMO
Javascript
HTML
CSS