jQuery.tag-editor插件

    xiaoxiao2022-07-06  191

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

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

    2、创建一个tag-editor

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

    3、其他属性

    Settings

    PropertyDefaultDescriptioninitialTags[]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自动完成。 

     

    最新回复(0)