A small hack for this is to add "Zero Width Space" between all the characters in the word. By doing this, word wrapping can happen between all the characters, but the users can not see them since the width of the spaces is zero. This can be done by the following small function:
function breakWords(str) {
Array.prototype.slice.apply(str).join("​");
}
没有评论:
发表评论