【发布时间】:2016-01-14 09:29:50
【问题描述】:
我使用dotdotdot截断指定高度框中的文本
<div class="product-description dotdotdot" style="word-wrap: break-word;">
<div class="product-description-icon">
<span>
<img src="product_gloves.png" alt="Gloves">
</span>
</div>
<h4>Gloves</h4>
<p>Some gloves text...</p>
</div>
jQuery :
$(".product-description.dotdotdot").dotdotdot({
watch: true
});
我的product-description dotdotdot的最小高度为100px,文本末尾有省略号,但文本没有被截断,还有很多可用空间。
感谢您的帮助
【问题讨论】:
-
您使用 jquery 椭圆插件而不只是使用 CSS 是否有原因? css-tricks.com/snippets/css/truncate-string-with-ellipsis
标签: dotdotdot