Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
jquery-ellipsis
Advanced tools
Readme
simple jquery plugin that excerpts text depending on lines or characters number.
Download using one of the following Methods
$ npm install --save jquery-ellipsis
$ bower install --save ellipsis
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>
ellipsis can be used in two different ways:
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>
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>
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. |
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. |
$('#paragraph').on('initialize.ellipsis', function() {
// do some stuff
});
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!
...
FAQs
ellipsis text depending on number of lines or number of chars
The npm package jquery-ellipsis receives a total of 164 weekly downloads. As such, jquery-ellipsis popularity was classified as not popular.
We found that jquery-ellipsis demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.