jQuery.tag-editor插件

1、引入jQuery和jQuery.tag-editor的包

  • jQuery.tag-editor的包包括css和js
  • jQuery的包一定要放在tag-editor的上面!!!!!!

2、创建一个tag-editor

$("#tag").tagEditor({
	placeholder:"添加完标签后请按enter~"
})

3、其他属性

Settings

PropertyDefaultDescription
initialTags[]Initial tags as an array of strings.初始标记为字符串数组。
maxTagsnullMaximum number of allowed tags.允许的最大标签数。
maxLength50maxlength attribute of the tag input field.标签输入字段的maxlength属性。
delimiter',;'

Required string of delimiters - characters for separating tags. The first character is used as default delimiter in the (hidden) original field.必需的分隔符字符串 - 用于分隔标记的字符。第一个字符用作(隐藏)原始字段中的默认分隔符。

placeholder''Placeholder text for empty tag editor.空标记编辑器的占位符文本。
forceLowercasetrueLowercase all tags.小写所有标签。
removeDuplicatestrueAutomatically remove duplicate tags.自动删除重复的标签。
clickDeletefalseDelete tags on right click and on Ctrl+click.右键单击并按住Ctrl +单击删除标签。
animateDelete175Animate duration for deletion of tags in milliseconds. Set to 0 for non-animated removal.删除标签的动画持续时间(以毫秒为单位)。设置为0表示非动画删除。
sortabletrueIf jQuery UI sortable is available and this option is set to true, tags are sortable by drag and drop.如果jQuery UI sortable可用且此选项设置为true,则可以通过拖放对标签进行排序。
autocompletenull

jQuery UI autocomplete options as key/value pairs object. If provided, jQuery UI autocomplete must be loaded additionally.

jQuery UI自动完成选项作为键/值对对象。如果提供,则必须另外加载jQuery UI自动完成。
 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值