user2779425
user2779425

Reputation:

javascript to achive the same result as css ellipsis

due to some reason I cant use the css method

text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
width: 100px;

the above make my user define text in a li if reached 100px, it will add '...', can it be achieve using jquery?

Upvotes: 0

Views: 46

Answers (1)

Ashis Kumar
Ashis Kumar

Reputation: 6544

You can simply use the Jquery ellipse plugin

$('#target').ellipsis({
    row: 2
});

Upvotes: 1

Related Questions