Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jquery-ellipsis

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jquery-ellipsis

ellipsis text depending on number of lines or number of chars

  • 0.1.6
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
117
decreased by-49.79%
Maintainers
1
Weekly downloads
 
Created
Source

ellipsis

simple jquery plugin that excerpts text depending on lines or characters number.

Build Status Coverage Status DevDependency Status


installation.

  1. 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
    
  2. please be sure to includejquery >= 2.x then include ellipsis:

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
    <script src="path/to/jquery.ellipsis.min.js"></script>
    

Usage

ellipsis can be used in two different ways:

  1. via data attributes.

      <p data-toggle="ellipsis" data-type="chars" data-count="150"> 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.</p>
    
  2. manual way:

    <p id="ellipsis_me">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.</p>
    
    <script>
    $(document).ready(function() {
      $('#ellipsis_me').ellipsis(options);
    });
    </script>
    

options

optiontypevalue
typeStringdetermines type is whetherchars or lines number that the text should be excerpted.
countNumberdetermines the number of chars or lines should the text be excerpted.

events

eventwhen
initialize.ellipsisbefore the initialization of the plugin
initialized.ellipsisafter the initialization.
excerpt.ellipsisbefore excerpt the text
excerpted.ellipsisafter the text being excerpted
update.ellipsisbefore updating when window is resized
updated.ellipsisafter updating.
example:
$('#paragraph').on('initialize.ellipsis', function() {
  // do some stuff
});

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.

Keywords

FAQs

Package last updated on 21 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc