Skip to content
This repository was archived by the owner on May 30, 2020. It is now read-only.

klickreflex/shortify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors