javascript - Truncate text to fit in 3 lines and show three dots in end In Html -


i need display text paragraph, display 3 lines , truncate test while adding ...(three dots) in paragraph end.

calculate max length of string can fit 3 lines , use following script

var maxlength = 140; var result = yourstring.substring(0, maxlength) + '...'; 

Comments

Popular posts from this blog

Python Kivy ListView: How to delete selected ListItemButton? -

asp.net mvc 4 - A specified Include path is not valid. The EntityType '' does not declare a navigation property with the name '' -