简体   繁体   中英

jquery - Facebook tagging

Is there a plugin that has similar behavoir like the Facebook tagging?

Whats so special about this, is that it features:

  • Autocomplete in between typed words
  • Special outputted html (which is synced with another input field)

标记示例

you can use jquery mention inputs plugin its similar to facebook mentions

or you can use jquery sew plugin

You can use the JQuery UI widget : which allows you to create a list of special words which will suggest + autocomplete te word when the user starts typing it.

You can handle the special formatted html by using the callback when a special word is chosen:

$( ".selector" ).autocomplete({
select: function( event, ui ) {}
});

Added:
It's also possible to trigger it in the middle of a sentence, I did found an example on JSfiddle which allows you to do this.

Press the @ anywhere in the sentence and type the first letter. You can change the select callback if you want some custom html arround it.

http://jsfiddle.net/UdUrk/

Hope this brings you closer to the solution.

Kevin

I'm glad you were able to find a solution that seems to fit your needs, OP. For anyone else who happens to stumble upon this (and OP if my assumption was wrong) who is looking for a robust, actively-maintained solution...

...check out Mentionator : it is a jQuery plug-in which enables clients to create highlighted references to ("mentions") to predefined entities in text areas. It is mantained by this guy right here :) .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM