Facebook 之类的状态输入
是否有现成的类似 Facebook 中状态输入的输入? 我的意思是,他们使用了一个 contenteditable div,并且他们把它包装得很好。他们可以调整它的大小(在焦点/模糊时),它会继续自动换行和扩展,当您在他们的输入中键入一个非常长的单词时,该单词无法换行,它会保留在 div 内并且不会与其他内容重叠它附近的元素..
请帮助我在 contenteditable div 上做这两件事,或者如果您知道现成的,请分享。
谢谢。
PS我确实尝试自己做,而不仅仅是懒惰。我几乎成功地阻止了重叠,但在调整高度大小后未能使 div 保持内容可编辑(自动换行、可扩展)。我也想过尝试了解 Facebook 自己是如何做到这一点的,但对于新手来说很难理解他们的代码,因为它们都是缩小的、压缩的等等。
Is there a ready similar input like the status input in Facebook?
I mean, they use a contenteditable div, and they've wrapped it all pretty good. They can resize it (on focus/blur), an it continues word-wrapping and expanding, and when you type a really long word in their input, which can't be wrapped, it stays inside the div and doesn't overlap other elements near it..
Please help me doing those two things on a contenteditable div, or if you know of a ready one, please share.
Thanks.
P.S. I did try doing it myself an not just being lazy. I almost succeeded in stopping the overlap, but didn't manage to make the div stay contenteditable(word-wrap, expandable) after a height resize. I also thought of trying to understand how Facebook do it by myself, but it's pretty hard for a newbie to understand their code as it's all minified and gzipped and whatnot.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
他们(Facebook)似乎正在使用这个 CSS
They (Facebook) seem to be using this CSS