rviscomi / trunk8

jQuery Truncation Plugin -- THIS PROJECT IS NO LONGER MAINTAINED
MIT License
703 stars 95 forks source link

Option to use data-lines (or similar) on the element #12

Open m9dfukc opened 11 years ago

m9dfukc commented 11 years ago

Would be nice to define a data element on the tag which states the amount of lines it should shorten to. Doing this manually in a loop for now but would be nice to have this build in.

woozyking commented 9 years ago

:+1:

fchristant commented 9 years ago

I agree it would be a nice feature. For now, I'm also using this loop, which is simply enough:

$('[data-truncate="true"]').each(function( index, element ) { $(element).trunk8({ lines: $(this).data("truncate-lines") }); });