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

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -