Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A simple ellipsis that works on characters count only and will append any string you want

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 README.md
Octocat-spinner-32 ellipsis.js
README.md

A ellipsis that works on characters count only and will append any string you want.

This simple function allows you to call ellipsis(), pass in a few parameters and get your new ellipsised string in return. Right now this only supports an ellipsis by character count vs my width/height of the container.

Example 1:

var originalString = 'This is a simple ellipsis script';
var finalString = ellipsis( originalString, 25 );

Output 1:

finalString = 'This is a simple ellipsis...'

Example 2:

var originalString = 'This is a simple ellipsis script';
var finalString = ellipsis( originalString, 25, '***' );

Output 2:

finalString = 'This is a simple ellipsis***'
Something went wrong with that request. Please try again.