vaakash / jquery-collapser

jQuery collapser is a small and useful jQuery plugin for collapsing/truncating an element text by words, characters and lines with a flexible API. It is an all in one plugin with multiple functionalities to truncate a paragraph or any element as desired.
MIT License
99 stars 35 forks source link

Collapser no longer works when contents of element change #11

Open nolawnchairs opened 7 years ago

nolawnchairs commented 7 years ago

This happens during an asynchronous load of new data, or via pop state.

    $('#video_description').html(this._manifest.videoDescription); 
    $('#video_description').collapser({ mode: 'lines', truncate: 5, speed: 'fast' }); 

In my example, the description changes, but the collapser no longer does its thing. The issue is the same regardless of whether I call collapser() on each time the content changes, or if it's only called once on the initial application page load.