Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否有一个 jquery truncate 插件在内容中没有 HTML 问题?
例如,这个插件不能很好地处理 HTML:
http://www.reindel.com/truncate/
我假设你有最新的版本。
这里还有一些可能会有所帮助。但无法评论它们的适用性:
http://github.com/jsillitoe/jquery-condense-plugin/tree
http://code.google.com/p/jquery-text-truncate/
Badonkatrunc以非破坏性方式支持嵌套内容。
(完全披露:我是插件的开发者。)
截断插件很好,但是对于我的使用来说,它没有很好地处理 p 标签,无法让阅读更多链接驻留在内联。
我发现这个成功了: http: //henrik.nyh.se/2008/02/jquery-html-truncate