Sugama's Tech BLOG

Stripe Calendar

Sep, 2010
Aug 1516171819202122232425262728293031 Sep 123456789

Infomation

Sugama's Tech BLOG

Javascript - jquery.clipstr.js

09.01.19 Comments(0) Post Comment

I developed a jquery plugin called clipstr.js. This plugin adjusts the innerText lengths to the parents width. You can see a working example on this Blog's right column, "Recent Entries" area and Comments area. This plugin also puts the original text into title attribute.

The plugin works with codes like this.

$('.boxsize_limited').clipstr({
    width       : 220,
    instead_str : '...',
    set_title   : false
});

You don't have to specify the width if the box width is limited. So all parameter's are optional.

source code

I'm not sure the namimg is valid or not. Should I call it 'collapsestr' or 'strlenLimitter'?

Comments

no comment exists

Form