【问题标题】:Emojione area causes problem executing hidden textarea eventsEmojione 区域导致执行隐藏的 textarea 事件出现问题
【发布时间】:2018-11-21 06:40:40
【问题描述】:

我在我的应用程序中使用emojionearea。由于这个插件隐藏了原始的textarea 并使用div 来显示和加载表情符号,因此在执行onkeyuponkeypress 等事件时会出现问题。这是我的代码:

<textarea id="Message" class="form-control" cols="80" rows="7" onchange="SMSCounter(this, event, in_array([], "Source"))" onblur="RefineCounter(this, in_array([], "Source"))" onkeypress="SetChar(event)" onkeyup="SMSCounter(this, event, in_array([], "Source"))" maxlength="765" style="width: 350px; height: 100px; float: right; display: none;" name="data[Message]" data-rel="tmplButton-solh0ecqbs"></textarea>

【问题讨论】:

标签: javascript html emojione


【解决方案1】:

您可以像这样使用您所在地区的选项中的事件:

$("selector").emojioneArea({
  events: {
    keyup: function (editor, event) {
     console.log('event:keyup');
    },
    keydown: function (editor, event) {
      console.log('event:keydown');
    }
  }
)

【讨论】:

    猜你喜欢
    • 2016-06-25
    • 2012-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-09-03
    • 2013-10-22
    • 1970-01-01
    • 2018-07-30
    • 1970-01-01
    相关资源
    最近更新 更多