Git Product home page Git Product logo

emoji's Introduction

emoji

轻量的js表情插件

功能

功能:传递表情对应的字符格式到后台,后台返回字符串,前端将该字符串解析展示成相应的表情展示在页面上。

使用方法:

  • 在option中配置需要的参数

var option = {
      emojiArray: ['angry'],     //填写表情字符串的数组,【注:源文件image下面的图标,只需要写红框内的字符串,详见下图】 
      textareaId: 'emoji-editor',   //输入框的id 
      loadId: 'load',                //加载表情的id 
      emojiContainer: 'emojiContainer',     //存储表情的容器对象 
      sendId: 'send',                      //发送信息的按钮 id 
      emojiTranslateCls:'emoji-comment',//需要转换成表情(img)的容器类名,只需要添加一个类,即可自动将:kissing_heart:渲染成表情~ 
};

/*调用方法*/
var text = new Emoji(option);
text.init();


  • 获取输入框的数据
text.toText();   

  • 将服务器返回的数据显示成表情 [只需给承载的容器加上类,即option的emojiTranslateCls]
  <div class="emoji-comment"> fork我的github或者给赞:kissing_heart::kissing_heart::kissing_heart:么么哒:heart::heart::heart:
  </div>
  

demo地址

emoji's People

Contributors

beidan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

emoji's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.