Plugins

The plugins site is currently in development.

We've been looking to provide a higher-quality, spam-free experience at the plugins site for some time, and a major error on our part forced us to shut down the current site before we could put the new one in place. We are developing a new site, and you can follow along with its development on GitHub. For more information about this transition, including steps you can take as a plugin author to prepare, please read our post about what's going on.

LimitCharWidth


This plugin allows you to collapse the inner text so that it adjust into specific width or container width.

Example

HTML

<div class='hide_overflow' style='width:50px'>
    Text that expected to be shown in one line
</div>

Javascript

$('div.hide_overflow').limitCharWidth();

This works as follows. The innter text fits into 50px width.

Result

<div class='hide_overflow' style='width:50px'>
    Text that expec...
</div>

USAGE

limitCharWidth({
    alternative : '...',
    width         : null,
    set_title     : false
});

Options

  • alternative : It appears at the end of string when the collapse occures.
  • width : The width can be given instead of the container width.
  • set_title : True causes the original string to put into title attribute of container.
unlimitCharWidth();

Issue

  • The container can't have child node.
  • Internally, a dummy span tag is put for measure the width. This is affected by CSS setting.

Downloads

Version Downloads Date Links
0.6-beta Notes


5
Your rating: None Average: 5 (1 vote)