2014-10-03 33 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

回答