Results 1 to 6 of 6
Jun 22, 2011, 03:08 #1
- Join Date
- Mar 2011
- 0 Post(s)
- 0 Thread(s)
Truncating text to (x) no. of lines
I'm just wondering if anyone has any ideas on something that's been puzzling me for a short while. I have a box on a website which is populated by a feed, which changes regularly. Because of limited space, I've truncated feed items to only show the first e.g. 150 characters, so only introductory text gets displayed.
The problem is that the size of 150 characters can vary greatly depending on what letters are being used - sometimes the content can fill all two lines (which is great), and sometimes it only fills one and a bit (which looks odd).
Does anyone know of a way, using JS, that I can truncate text to just being two lines, regardless of the number of characters?
Sorry - I don't have a public URL to show as an example. Hope that makes sense, and thanks for your help!