控制显示较多文字后显示省略号
This commit is contained in:
parent
9a3acdd1db
commit
b100651185
|
@ -14,7 +14,7 @@ app.directive('ellipsisShow',["$timeout",function(timer){
|
||||||
newContent = newContent + textSplit[i];
|
newContent = newContent + textSplit[i];
|
||||||
element.text(newContent);
|
element.text(newContent);
|
||||||
if(element[0].scrollHeight >= 100){
|
if(element[0].scrollHeight >= 100){
|
||||||
newContent = newContent + textSplit[i+1] + textSplit[i+2] + textSplit[i+3] + textSplit[i+4] + "...";
|
newContent = newContent + textSplit[i+1] + textSplit[i+2] + textSplit[i+3] + textSplit[i+4] + textSplit[i+5] + textSplit[i+6] + textSplit[i+7] + textSplit[i+8] + textSplit[i+9] + textSplit[i+10] + "...";
|
||||||
element.text(newContent);
|
element.text(newContent);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue