rviscomi / trunk8

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

lines: 'auto' for css max-height:val and overflow:hidden elements #76

Closed EdwardBlair closed 8 months ago

EdwardBlair commented 8 years ago

Includes basic ability to determine line_height from .el { max-height: val; overflow:hidden }.

If lines is set to 'auto' we use $(element).height() as the line_height and use $(element).prop('scrollHeight') as the content height. Otherwise default (previous) behaviour is used.

Default value of lines is still 1.

Check the demo. This works 'fine for me'. Thanks a lot for this plugin, it's very efficient.

Feedback/improvements welcomed.

rviscomi commented 8 years ago

Cool feature, thanks for working on it.