简体   繁体   English

如何在类似于Gmail和Facebook的文本区域中实现表情符号

[英]How to implement emoji in textarea similar to gmail and facebook

How would I go about this? 我将如何处理? Are they images? 他们是图像吗?
How can I make it so that when the user types ':D' it turns into a face emoji? 我怎样才能使它在用户键入':D'时变成面部表情符号?

A general explanation would be great. 一般的解释会很好。 I have no idea how you can put images in textareas. 我不知道如何将图像放入文本区域。

Emojis are just unicode, not images, so they can be used as text. 表情符号只是unicode,而不是图片,因此可以用作文本。 To change their look, use a different font: 要更改其外观,请使用其他字体:

摘自http://www.businessinsider.com/unicode-emoji-chart-2015-12

Extracted from http://www.businessinsider.com/unicode-emoji-chart-2015-12 摘自http://www.businessinsider.com/unicode-emoji-chart-2015-12


But they aren't on (fisical) keyboards, so what some services do is to put a lot of buttons with their corresponding emoji so you can type them easily. 但是它们不在(虚拟)键盘上,因此某些服务要做的是在许多按钮上放置相应的表情符号,以便您轻松键入它们。

But what YounesM said is also true: 但是YounesM所说的也是正确的:

... you could simply have a script that look for ' :D ' and replace it by 😃 ...您可以简单地使用一个脚本来查找':D'并将其替换为😃

Other services, instead of filling a div with button s, run a script when you create or edit a post/question/answer/comment/other for replacing specific substrings with emoji. 其他服务的,而不是填充divbutton S,当您创建运行一个脚本或编辑后/问题/答案/评论/其他与表情符号替换特定的字符串。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM