I use dotdotdot to truncate text in height specified box
<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
});
My product-description dotdotdot have a min-height of 100px, and the text have the ellipsis at the end, but the text is not truncated and there is still a lot of free space.
Thank you for your help
I have downloaded dotdotdot and followed the README.md and it is working fine (except on
$(window).resize).You might need to provide more context with your question:
.jsfiles in the<head>of your markup and in the right order?$(document).ready(function() {your script});I haven't looked in depth at the dotdotdot script yet. Mine is firing using exactly this script:
At a glance I am wondering if your choice of class name
.dotdotdotmight be causing issues. Perhaps rename your class(es) to read.product-description-wrapperand run the script on that class.Hope this helps you