I have been working with Brian Reindel's Truncate plug-in....trying to get ti
to do what I need.  It seems simple enough, but I continue to struggle.  The
plug-in is designed to truncate the html content within a tag to a certain
length...taking into consideration the whole last word.  It works
great...however I need to truncate a list item that contains both text and a
link; like so:

<li>This is the text that leads to:  # A link that needs to be truncated
.</li>

The function currently looks like this:

$('li a').truncate( {
                  length: 35,
                  minTrail: 10,
                  moreText: '',
                  lessText: '',
                  ellipsisText: "..."
         });

But this obviously only takes care of the link...if the text behind it is
too long it will still push the truncated link down to the next line...If I
try to do the li it completely removes the link tag no matter its
length....and if I try to change the selector in the plugin from
$(this).html() to $(this).text() it removes the anchor tag
completely....though it works just fine.  

Basically I need some way to keep my anchor tag in operation, yet take the
whole text contained within the li into consideration when determining where
to truncate.  Your help is much appreciated...Please let me know if you have
any questions to further clarify my problem.  Thanks.

btw...the Plugin is located here in case you'd like to see it or use it
yourself: http://www.reindel.com/truncate/
-- 
View this message in context: 
http://www.nabble.com/jQuery-Truncating-Help-tp19791107s27240p19791107.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.

Reply via email to