Trucating long text w/jQuery
<p>Quick disclaimer: I saw some plugins that truncate text strings but they do not do it the way I need it...</p>

<p>I need to truncate the text by limiting the space allocated to it. For example, if i have a block of text and it is placed in a div that has dimensions preventing entire text to be shown, I' like to show as much as possible and then append helix at the end of the string.</p>

<p>I think I can use overflow:hidden, but how do I add "..."? Also, is it possible to determine if the text needs more space than the area provide?  </p>

<pre><code>&lt;div style="width: 300px; height: 100px; border: 1px solid #ccc; overflow:hidden"&gt;
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis facilisis risus vel mi placerat ut bibendum dui tempus. In dictum quam eu sem condimentum elementum. Cras id urna eget turpis feugiat porttitor. In hac habitasse platea dictumst. Cras tincidunt risus id sapien sagittis feugiat interdum orci adipiscing. Sed venenatis neque nec nibh mattis laoreet. In ut sapien in felis posuere feugiat. Nulla vulputate, augue nec elementum volutpat, justo nisl vulputate tellus, eget blandit lectus enim at ante. Donec posuere augue a orci sollicitudin ut imperdiet ante varius. 
&lt;/div&gt;
</code></pre>

<p><a href="http://jsfiddle.net/5rhMz/" rel="nofollow">DEMO</a></p>
