I just hacked this together.
You can use it by calling trunc for all the elements on which you want to see a larger label. You pass it the argument of the maximum number of words in the unextended text.
Example:
// truncate all text in elements with class "truncateme" to be 10 words or less // (until you click the "see more" link) $(".truncateme").trunc(10);
source share