Padding text with ellipsis if it's too long
<p>Hi I'm trying to solve a jQuery problem. I'm using a wordpress plugin that creates a widget from recent posts. The plugin auto-generates some code that I'm sort-of trying to format/hack with CSS and jQuery. One of the items that is auto generated is a headline:</p>

<pre><code>&lt;h4 class="srp-post-tilte"&gt;HEADLINE HERE&lt;/H4&gt;
</code></pre>

<p>My design depends on this headline not exceeding a given length. (about 45 characters). The plugin provides an option to add an elipsis after the headline for this very issue (I set it to 45 characters). The problem is that when the headline is under 45 characters the elipses still show up.</p>

<p>So, I've turned off the feature and am trying to do it in jQuery. I'd only like to add an elipsis in situations where the headline is cropped to 45 characters. I tried this, but it's not working. </p>

<pre><code>if ($j("h4.srp-post-title").val().length &gt; 44) { 
         // Show the elipsis
            $j('h4.srp-post-title').append("...");
} else {
         // Don's show the elipsis (do nothing)
        $j('h4.srp-post-title').append("");
}
</code></pre>

<p>If anyone out there can help, it would be very much appreciated. You can see a live example at <a href="http://dreamlets.sfplanning.org/" rel="nofollow">http://dreamlets.sfplanning.org/</a> but be forewarned, there is a lot of CSS therein, so it may be tricky to decipher what's going on under the hood.</p>

<p>Thanks in advance. Your help in resolving this is huuuuuugley appreciated.</p>

<p>-Paul</p>
