“More”/”less” style truncation. Handles HTML gracefully: doesn’t split inside HTML entities, doesn’t orphan end-tags and so on.
Example usage:
$(function() { $('.example').truncate({max_length: 24}); });
Overriding all defaults:
$(function() { $('.example').truncate({max_length: 24, more: "plus it", less: "nevermind"}); });