JavaScript 的 Emoji 轉換庫:js-emoji

jopen 10年前發布 | 151K 次閱讀 js-emoji 常用工具包

js-emoji 可以讓你在瀏覽器上顯示 Emoji 表情,使用方法:

<link href="emoji.css" rel="stylesheet" type="text/css" />
<script src="emoji.js" type="text/javascript"></script>
<script type="text/javascript">

// replaces \u{1F604} with platform appropriate content
var output1 = emoji.replace_unified(input);

// replaces :smile: with platform appropriate content
var output2 = emoji.replace_colons(input);

// force text output mode
emoji.text_mode = true;

// show the short-name as a `title` attribute for css/img emoji
emoji.include_title = true;

// change the path to your emoji images (requires trailing slash)
// you can grab the images from here:
// https://github.com/github/gemoji/tree/master/images/emoji/unicode
emoji.img_path = "http://my-cdn.com/images/emoji/";

// find out the auto-detected mode
alert(emoji.replace_mode);

</script>

項目主頁:http://www.baiduhome.net/lib/view/home/1403079020825

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!