2014-10-03 28 views
0

我使用以下插件作为一个完整的文字识别空间:http://yuku-t.com/jquery-textcomplete/jQuery.textcomplete需要在价值

目前我可以输入@,它显示我的值,然后选择高亮时使用覆盖的列表(见在网站上使用jQuery.overlay部分)。你不能做的是在一个值中有一个空格,所以“@My value”只会突出显示“@my”。我希望看到整个价值并认识空间。

有谁知道这是可能的吗?

下面是功能使用:

function SMSTextArea() { 
    $('.intellisense').textcomplete(
     [ 
      { // Intrinsics 
       mentions: pullArrIntrinsicsVar(), 
       match: /\[email protected](\w*)$/, 
       search: function (term, callback) { 
        callback($.map(this.mentions, function (mention) { 
         return mention.indexOf(term) === 0 ? mention : null; 
        })); 
       }, 
       index: 1, 
       replace: function (mention) { 
        return '@i' + mention + ' '; 
       } 
      } 

     ], 
     { appendTo: 'body' } 
    ).overlay(
     [ 
      { 
       match: /\[email protected]\w+/g,      // Intrinsics 
       css: { 
        'background-color': '#DDFFD1' 
       } 
      } 
     ] 
    ); 
+0

你可以准备的jsfiddle – 2014-10-03 14:19:41

回答