Last Updated: February 25, 2016
·
3.049K
· rebyn

Truncate text to lines, not number of characters

trunk8 is a JS library that helps truncate text to a specific number of lines, not characters.

$('#t8-lines').trunk8({
  lines: 2
});

In the end we'll have something like:

The library also provides features like custome fill</code>, update</code>, etc.

1 Response
Add your response

Solid. Very solid. This will make frontend dev work much easier for the designer's eyes looking over my shoulder. Couple this with the proper character fall back, and it's a daggom fine tool. Thanks for sharing.

over 1 year ago ·

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Did you know?

JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.

Security insights from Cside