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

How can I call the reInit method? #13

Open jjkiko opened 6 years ago

jjkiko commented 6 years ago

How can I call the reInit method? An example?. I want to use it on my website, to differentiate in case of responsive.

pugfuglygames commented 6 years ago

I had this issue, eventually got it to work like this:

$item.data("collapser").reInit($item);

Be aware that also there is a bug in the reInit code which may affect you.

This code:

if (s.mode == 'chars' || 'words') {

should read:

if (s.mode == 'chars' || s.mode == 'words') {