ellipsis
simple jquery plugin that excerpts text depending on lines or characters number.
installation.
-
Download using one of the following Methods
- direct download or clone from this repository.
- via npm
$ npm install --save jquery-ellipsis- via bower
$ bower install --save ellipsis -
please be sure to include
jquery >= 2.x
then include ellipsis:
Usage
ellipsis can be used in two different ways:
-
via
data
attributes.Amet id nisi ipsa pariatur eaque aperiam dolorum eius quia, vero provident? Doloremque impedit at cupiditate illum magnam, quo, vel corrupti. Esse voluptates hic vitae porro temporibus temporibus! Possimus rem. -
manual way:
Amet id nisi ipsa pariatur eaque aperiam dolorum eius quia, vero provident? Doloremque impedit at cupiditate illum magnam, quo, vel corrupti. Esse voluptates hic vitae porro temporibus temporibus! Possimus rem.
options
option | type | value |
---|---|---|
type | String | determines type is whetherchars or lines number that the text should be excerpted. |
count | Number | determines the number of chars or lines should the text be excerpted. |
events
event | when |
---|---|
initialize.ellipsis | before the initialization of the plugin |
initialized.ellipsis | after the initialization. |
excerpt.ellipsis | before excerpt the text |
excerpted.ellipsis | after the text being excerpted |
update.ellipsis | before updating when window is resized |
updated.ellipsis | after updating. |
example:
;
Features:
- enhance the puplic API
-
two different types of excerpts by lines/characters
-
Support re-adjust option later.
-
different custom event through the life cycle of the plugin.
-
Destroyable.
-
data attribute automatic init.
-
Up comming!
- use dedicated word instead of
...
- use url to show more.
- use link class to control the style of link.
- use dedicated word instead of
-