I have a webpage with an elastic layout that changes its width if the browser window is resized.
In this layout there are headlines (h2) that will have
h2
you can do this much easier with css only, for example : sass mode
.truncatedText { font-size: 0.875em; line-height: 1.2em; height: 2.4em; // 2 lines * line-height &:after { content: " ..."; } }
and you have ellipsis ;)