JQuery tagsinput application in h5 mail client _jquery

Source: Internet
Author: User

Summary

has been tossing the H5 application of the mail recently, in order to ensure that it can be used on the pc,ios,android side, so use the H5 page to embed the app WebView.

Page

The UI is probably like this

Jquery tagsinput Download: http://xoxco.com/projects/code/tagsinput/

First to introduce JS and CSS

Input box

 
 

The above input box, has the default value, you can call Tagsinput method directly, make it into tags

 
 

If you want to add the AutoComplete feature, you can add the following parameters

$ (' #tags '). Tagsinput ({
autocomplete_url: ' Http://myserver.com/api/autocomplete ')

You can add and remove tags through the Addtag and Removetag methods.

$ (' #tags '). Addtag (' foo ');

You can add more than one tag at a time by using the following method

 
 

Note: If the method is empty, the input content is emptied.

You can tell if a tag already exists

 
 

If you want to do something else after adding or deleting it, the plugin also provides a callback function to add and remove.

$ ("#tags"). Tagsinput ({////
' Autocomplete_url ': URL_TO_AUTOCOMPLETE_API,/////
' AutoComplete ': {option: Value, Option:value},
//' height ': ' 100px ',
//' width ': ' 300px ',
//' interactive ': true,
//' DefaultText ': ' Add a tag ',
//' Onaddtag ': function (tag) {
//console.log (' added ', tag);
},
//' Onremovetag ': function (tag) {
//console.log (' removed ', tag);
},
//' OnChange ': function (tag) {
//Console.log (' changed ', tag);
},
//' delimiter ': [', ', '; '],//or a string with a single delimiter. Ex: '; '
' Removewithbackspace ': true,
//' Minchars ': 0,
//' Maxchars ': 0,//If not provided there is no limit
// ' Placeholdercolor ': ' #666666 '
//});

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.