🔔 Alert..!! Get 2 Month Free Cloud Hosting With $200 Bonus From Digital Ocean ACTIVATE DEAL

Shortify is a jQuery plugin which truncates your long text to a specified number of characters and displays the full text in a tooltip when hovering over the ellipsis.

Text-Truncating

Documentation

Shortify

Shortify is a very basic jQuery plugin that truncates a DOM element and shows its full text within a tooltip if its length exceeds the character limit.

Tooltip styling is taken from Chris Bracco, check his article A Simple CSS Tooltip.

Setup & Usage

Make sure jQuery, jquery.shortify.js and tooltips.css are loaded and call the plugin on any selector you want to shortify:

$(".long-field").shortify({   // Options    char_limit: 90,   position:  "tooltip-bottom",   ellipsis: '...' }); 

Options

  • char_limit: When should truncation start, defaults to 100
  • position: where to place the tooltip: tooltip-top (default), tooltip-right, tooltip-bottom, tooltip-left
  • ellipsis: symbol or text to put after the truncated text, defaults to …

You May Also Like