It is a plugin for jQuery that truncates strings to a given number of characters, appending an ending string like "...". When the user hovers over the string, the original text is shown with an animation, overlaping the truncated one.
If the original string length is minor than maxLength, the script does nothing.
- maxLength : Max characters to show in final truncated string. Minus endString length (default = 20)
- background : Color for text background. CSS style (default = 'transparent')
- opacity : Opacity of tooltip (default = 1)
- offsetY : Top offset for tooltip from original text position (default = 0)
- offsetX : Top offset for tooltip from original text position (default = 0)
- endString : When string is truncated, this string is appended (default = '...')
- Need the jQuery library (http://jquery.com/)
- Fire it! Example:
$(document).ready( function() { $('h2.truncate').strTruncator({'background':'white', 'maxLength':50}); })
e-mail: [email protected] twitter: @raullealm