npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@jpeer/jquery.dotdotdot

v1.8.3

Published

A jQuery plugin for advanced cross-browser ellipsis on multiple line content.

Downloads

1,474

Readme

jQuery.dotdotdot

A jQuery plugin for advanced cross-browser ellipsis on multiple line content. Demo's and documentation: http://dotdotdot.frebsite.nl

Note: Because its performance can not be improved, this plugin is no longer actively maintained. Feel free to use it and submit pull requests though.

How to use the plugin

Integration to your page

Include all necessary .js-files inside the head-tag of the page.

<head>
    <script src="jquery.js" type="text/javascript"></script>
    <script src="jquery.dotdotdot.js" type="text/javascript"></script>
</head>

Then you can use either CSS or JS approach or use them both.

CSS approach

You can add one or several CSS classes to HTML elements to automatically invoke "jQuery.dotdotdot functionality" and some extra features. It allows to use jQuery.dotdotdot only by adding appropriate CSS classes without JS programming.

Available classes and their description:

  • dot-ellipsis - automatically invoke jQuery.dotdotdot to this element. This class must be included if you plan to use other classes below.
  • dot-resize-update - automatically update if window resize event occurs. It's equivalent to option watch:'window'.
  • dot-timer-update - automatically update if window resize event occurs. It's equivalent to option watch:true.
  • dot-load-update - automatically update after the window has beem completely rendered. Can be useful if your content is generated dynamically using JS and, hence, jQuery.dotdotdot can't correctly detect the height of the element before it's rendered completely.
  • dot-height-XXX - available height of content area in pixels, where XXX is a number, e.g. can be dot-height-35 if you want to set maximum height for 35 pixels. It's equivalent to option height:'XXX'.

Examples

Adding jQuery.dotdotdot to element:

<div class="dot-ellipsis">
	<p>Lorem Ipsum is simply dummy text.</p>
</div>

Adding jQuery.dotdotdot to element with update on window resize:

<div class="dot-ellipsis dot-resize-update">
	<p>Lorem Ipsum is simply dummy text.</p>
</div>

Adding jQuery.dotdotdot to element with predefined height of 50px:

<div class="dot-ellipsis dot-height-50">
	<p>Lorem Ipsum is simply dummy text.</p>
</div>

Javascript approach

Create a DOM element and put some text and other HTML markup in this "wrapper".

<div id="wrapper">
    <p>Lorem Ipsum is simply dummy text.</p>
</div>

Fire the plugin onDocumentReady using the wrapper-selector.

$(document).ready(function() {
    $("#wrapper").dotdotdot({
        // configuration goes here
    });
});

Authors and Contributors

More info

Please visit http://dotdotdot.frebsite.nl

Licence

The jQuery.dotdotdot plugin is licensed under the MIT license: http://en.wikipedia.org/wiki/MIT_License