Options
All
  • Public
  • Public/Protected
  • All
Menu

clampy

Clamps an HTML element by adding ellipsis to it if the content inside is too long.

Build Status GitHub issues GitHub license npm

This is basically a fork of the (unfortunately abandoned) project Clamp.js partially converted to Typescript and bundled using the excellent Typescript library starter from Alex Jover.

Most fixes from pull requests on the original project were included.

*Note that the following options were removed from the original library:

  • useNativeClamp
  • animate

Documentation

Documentation is available here.

Examples

A demo is available here.

Index

Functions

clamp

  • Clamps (ie. cuts off) an HTML element's content by adding ellipsis to it if the content inside is too long.

    export

    Parameters

    • element: HTMLElement

      The HTMLElement that should be clamped.

    • Optional options: ClampOptions

    Returns ClampResponse

    The Clamp response

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc