Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/chipbell4/tagger

JavaScript/jQuery plugin for tagging
https://github.com/chipbell4/tagger

Last synced: 9 days ago
JSON representation

JavaScript/jQuery plugin for tagging

Awesome Lists containing this project

README

        

Tagger
======

jQuery plugin for tagging

## How to use it ##

A call to the plugin generally looks something like:
```javascript
$('#tagContainer').tagInput({
nameData:names,
idData:ids,
alreadyAttachedIndices: attached,
hiddenInputNamePrefix: 'tag_',
});
```
The plugin is called with tagInput, and takes a dictionary of settings. The first setting,
nameData specifies a list of strings to display for the tag. The next setting idData specifies a unique ID for the item. The plugin assumes that these are the same length. The next setting alreadyAttachedIndices specifies the indices of the items that should already be attached at load time. The last setting- hiddenInputNamePrefix specifies the name prefix of the hidden tag generated when a tag is added to the list. So for the above case, there would be a hidden tag that looks like
```html

```

The plugin generates markup and adds some classes to certain elements. There are three containing divs generated by the plugin: the one containing the input element and the button, which has a class tagInputBox, the second containing the current list of suggestions, having a css class of tagSuggestionsContainer, and the last being the list of attached tags, having a class attachedTagsContainer.

Each suggestion is in its own div, as is each attached item.