pvdspek / jquery.autoellipsis

Auto-ellipsis plugin for jQuery
http://pvdspek.github.com/jquery.autoellipsis
MIT License
142 stars 32 forks source link

When updating the value of an element, and running autoellipsis again - it doesn't work #18

Open mohoch1 opened 11 years ago

mohoch1 commented 11 years ago

Hi. I am using the autoellipsis, and in general it works very well. The problem comes when I need to update the text of the element. One would assume that changing the text of the element and calling the plugin again would perform the same action the initial call performed.

But, as can be seen in this fiddle - it doesn't http://jsfiddle.net/mohoch/PxszR/3/

The only way I could make it work is by deleting the data stored on the element, and by this making the plugin run "from scratch".

designosis commented 11 years ago

if you call ellipsis once like so ... $('.ellipsis').ellipsis({live:true}); ... and it will work as expected, updating as the content changes.

If you have many of .ellipsis elements, however, browser performance becomes quite sluggish.

mohoch1 commented 11 years ago

Well... I do have many elements with ellipsis,. and anyway my app as very intensive, and I can't spare any resources. Thanks anyway

matths commented 8 years ago

Even when I add live:true to the options of the first call to .ellipsis() in the mentioned jsfiddle, it does not update the ellipsis, when I change the content using jQueries .text('new content') or .html('new content'). And another call to .ellipsis() has no effect. What am I doing wrong here?