Stack Overflow style tagging system in jquery

橙三吉。 提交于 2019-12-03 13:54:49

问题


I am wondering if there is a prebuilt clone (or very similar) to the Stack Overflow tagging system.

I have done some Googling however cannot find any powered by jquery.


回答1:


Here is my implementation (which I think is much more true to the SO style than is the accepted answer). The style may need tweaking but it's functionally the same as you see on SO.

Features:

  • Takes a predefined input field with words separated by commas -- perfect for all cases such as those in which you are editing an item that already has tags -- and builds the interactive tag editor from this information.

    example in rails format:

     <input id="post_tag_list" name="post[tag_list]" value='testing, test, probably, goose, under_score'/>
    
  • Updates a hidden input field as the user edits tags so that the submitted form will have all desired tags.

  • Deleting backwards through the (fake) tag input field is functionally the same as deleting one long string of words, making editing more natural.

  • Tags can be clicked on to edit.

  • Commas, spaces, returns, and tabs close an open tag that is being edited or created.

  • Close button on tags functions as expected.

  • etc.

Find it here: http://jsfiddle.net/bradleygriffith/axjKm/




回答2:


I ended up building my own implementation:

http://webspirited.com/tagit/index.php?themeroller=true#demo8



来源:https://stackoverflow.com/questions/4869008/stack-overflow-style-tagging-system-in-jquery

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!