我正在尝试使用dotdotdot插件在面板中显示评论列表,但结果不欢呼:
从下面的xhtml代码:
<li>
<h:link value="#{Comment.commentAuthorName}: " id="goToProfileWithAuthorName"
outcome="/profile.xhtml" type="submit"
style="text-decoration:none;font-weight:bold;font-size: 11px;color: rgb(120,120,159);">
<f:param name="userId" value="#{Comment.comauthorId}"/>
</h:link>
<div id="wrapper">
#{Comment.commentText}
</div>
<br></br>
<abbr class="timeago" title="#{Comment.commentDate}"
style="color: #778899;font-size: 10px;">
</abbr>
<br/>
</li>
和下面的js代码:
$(document).ready(function() {
$("#wrapper").dotdotdot({
// configuration goes here
});
})
如果我解决了溢出的问题,也许可以解决垂直尺寸的问题,但是我想关于点点的东西是不正确的。让我向您展示另一件事:
如您所见,似乎div(wrapper)width值计算正确,但文本一直溢出。可能是什么原因?
感谢您的帮助。
最佳答案
试试这个
div#wrapper{
word-wrap: break-word;
}