我正在尝试使用 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
});
})
如果我解决了溢出问题,我也许可以解决垂直尺寸问题,但我猜想 dotdotdot 有一些不正确的地方。让我告诉你一件更奇怪的事情:
如您所见,似乎 div(wrapper) 宽度值计算正确,但文本不断溢出。可能是什么原因?
感谢您的帮助。