So say i have a <div> with a long text inside and defined height, and when text overflows that div height i want to display ... at the end of the text, so this is easy with a little css, but i want something a bit more advanced.
What i want is to have that ... and a button (Show more), and i kind of made it, but it’s quite a dirty hack and i know there should be better solution, anyways please take a look a this fiddle: http://jsfiddle.net/DgBR2/1/
Basically i just floated another div with white background on top of the text, but if i would want to change that text height or something else this would create problems in the future, so i want something better.
Revised 11/07/2012
Robust Text Overflow Slider
Robust Fiddle
Features:
1. Auto adjusts for font size
2. Auto Adjusts for ‘Show More / Show Less’ Buttons
3. Easily Change Animation Speed
4. Easily Change ‘Show More / Show Less’ Button Spacing
5. Easily Choose Which side the ‘Show More / Show Less’ Displays On
6. Easily Set how many Lines of Text should initially appear
JQuery
HTML
CSS