예제 : https://codepen.io/publisherkim/pen/MWZrpYG
function ellipsis(elem, max) {
elem.each(function () {
var textLength = $(this).text().length;
var text = $(this).text();
if (textLength > max) {
$(this).text(text.substr(0, max - 3) + '…');
};
});
};
// use : ellipsis(selecter, maxlength);
ellipsis($('.txt'), 85);
728x90
'퍼블리싱 > HTML | CSS | Javascript' 카테고리의 다른 글
inputmode 모바일 가상키보드 레이아웃 설정 (0) | 2023.09.22 |
---|---|
html파일 include 해서 사용하기 (0) | 2023.09.22 |
간단한 좋아요 버튼 css 애니메이션 simple like button animation (0) | 2023.09.21 |
간단한 css gradient shadow animation (0) | 2023.09.20 |
scroll down button effect only css (0) | 2023.09.18 |