What is the plug-in that adds the 'hot label? As shown in the following figure.

Source: Internet
Author: User
What is the plug-in that adds the 'hot label? As shown in. I don't think this is self-developed by myself. it should be plug-ins, but I can't find specific plug-ins,
Let's talk about it.


Reply to discussion (solution)

I don't know about this plug-in. I wrote something similar using jquery.

I don't know about this plug-in. I wrote something similar using jquery.


Can you share the source code? learning and learning?

This is complicated. autocomplete is used during the search, and the style is written by yourself.

$ ("# Ask-search-tag "). autocomplete (wd_gettagUrl, {matchContains: true, delay: 500, cacheLength: 100, matchSubset: true, minChars: 1, width: 250, max: 20, extraParams: {type: 'fastrequest'}, scrollHeight: 500, parse: function (data) {return $. map (eval (data), function (row) {return {data: row, value: row. tagname, result: row. id, result1: row. fave_count, result2: row. tagimg}) ;}, formatItem: function (row, I, max) {if (row. id = 0) {return 'create' + row. tagname + 'topic ';} if (row. id =-1) {return ''+ row. tagname + 'under review ';} if (row. id =-2) {return 'use existing topic';} return'

'+ Row. tagname +'

';}}). Result (fastaskaddtag); var addid = 1; function fastaskaddtag (event, item) {$ ("# ask-search-tag "). val (''); if (item. id =-1 | item. id =-2) {return false;} var err_tag = $ ('. err_tag'); err_tag.hide (); var tagcount = $ ("# ask-tags-item p "). length; if (tagcount> = 5) {err_tag.text ('add up to five topics '). show (); $ ("# ask-search-tag "). hide (); return false;} var exists = ''; $ ('# ask-tags-item a [name = removetag]'). each (functio N () {if (item. id = $ (this). attr ('data') & item. id! = 0) {exists = 1 ;}}) $ ('# ask-tags-item span '). each (function () {if (item. tagname = $ (this ). text () {exists = 1 ;}}) if (exists = 1) {err_tag.text ('added topic '). show (); return false;} var length = mb_strlen (item. tagname); var sublen = Math. ceil (length/2); if (sublen> 25) {err_tag.text ('topic length can only be 50 characters or 25 Chinese characters '). show (); return false;} var addstatus = 1; var addmsg = ''; if (item. id = 0) {$. ajax ({type: 'post', url: wd_AddTagBySearchUrl, async: false, data: {tagname: item. tagname}, success: function (res) {res = eval ("(" + res + ")"); addstatus = res ['status']; addmsg = res ['MSG ']; item. id = res ['MSG '] ;}}) ;}if (addstatus = 0) {if (addmsg = 'login') {showLogin ();} else {$ ('. err_tag '). text (addmsg); $ ('. err_tag '). show (); $ ("# ask-search-tag "). flushCache ();} return false;} var addhtml ='

'+ Item. tagname +'

'; $ ("# Ask-tags-item "). append (addhtml); if (tagcount + 1) = 5) {$ ("# ask-search-tag "). hide () ;}$ ("# ask-tags-item a [name = removetag]"). unbind ('click '). click (function () {removetag ($ (this ));})}

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.