gpt4 book ai didi

javascript - jQuery dotdotdot 插件不工作

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:55:08 26 4
gpt4 key购买 nike

我正在尝试使用 dotdotdot 插件在面板中显示评论列表,但结果并不令人高兴:

comments

来自下面的 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 有一些不正确的地方。让我再给你看一件奇怪的事:

dotdot2

如您所见,似乎 div(wrapper) 宽度值计算正确,但文本不断溢出。可能是什么原因?

感谢您的帮助。

最佳答案

试试这个

div#wrapper{
word-wrap: break-word;
}

关于javascript - jQuery dotdotdot 插件不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15991444/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com