Home > Backend Development > PHP Tutorial > 请问这种添加‘热门标签’的插件是什么?如下图所示

请问这种添加‘热门标签’的插件是什么?如下图所示

WBOY
Release: 2016-06-13 12:19:57
Original
957 people have browsed it

请教这种添加‘热门标签’的插件是什么?如下图所示。

看源码里的写法,我不觉得这是自己自主开发的,应该是插件吧,但是我找不到具体插件,
有知道的说一下吧。
------解决思路----------------------
这个比较杂,搜索的时候用到了autocomplete,样式就自己写

<br />$("#ask-search-tag").autocomplete(wd_gettagUrl,{<br />    matchContains:true,<br />    delay:500,<br />    cacheLength:100,<br />    matchSubset:true,<br />    minChars:1,<br />    width:250,<br />    max:20,<br />    extraParams:{type:'fastask'},<br />    scrollHeight:500,<br />    parse: function(data){<br />        return $.map(eval(data), function(row) {<br />            return {<br />                data: row,<br />                value: row.tagname,<br />                result: row.id,<br />                result1:row.fave_count,<br />                result2:row.tagimg<br />            }<br />        });<br />    },<br />    formatItem: function(row, i, max){<br />        if(row.id==0){<br />            return '<span>创建 '+row.tagname+' 话题</span>';<br />        }<br />        if(row.id==-1){<br />            return '<span>'+row.tagname+' 正在审核</span>';<br />        }<br />        if(row.id==-2){<br />            return '<span>请使用已存在的话题</span>';<br />        }<br />        return '<img     style="max-width:90%"  style="max-width:90%" src="'+row.tagimg+'"/ alt="请问这种添加‘热门标签’的插件是什么?如下图所示" ><p>'+row.tagname+'</p>';<br />    }<br />}).result(fastaskaddtag);<br />var addid=1;<br />function fastaskaddtag(event,item){<br />    $("#ask-search-tag").val('');<br />    if(item.id==-1 <br><font color='#FF8000'>------解决思路----------------------</font><br> item.id==-2){<br />        return false;<br />    }<br />    var err_tag=$('.err_tag'); err_tag.hide();<br />    var tagcount=$("#ask-tags-item div").length;<br />    if(tagcount>=5){<br />        err_tag.text('最多添加五个话题').show();<br />        $("#ask-search-tag").hide();<br />        return false;<br />    }<br />    var exists='';<br />    $('#ask-tags-item a[name=removetag]').each(function() {<br />        if(item.id==$(this).attr('data') && item.id!=0){<br />            exists=1;<br />        }<br />    })<br />    $('#ask-tags-item span').each(function() {<br />        if(item.tagname==$(this).text()){<br />            exists=1;<br />        }<br />    })<br />    if(exists==1){<br />        err_tag.text('已添加过该话题').show();<br />        return false;<br />    }<br />    var length=mb_strlen(item.tagname);<br />    var sublen=Math.ceil(length/2);<br />    if(sublen>25){<br />        err_tag.text('话题长度只能是50个字符或25个汉字').show();<br />        return false;<br />    }<br />    var addstatus=1;<br />    var addmsg='';<br />    if(item.id==0){<br />        $.ajax({<br />            type:'post',<br />            url:wd_AddTagBySearchUrl,<br />            async:false,<br />            data:{<br />                tagname:item.tagname<br />            },<br />            success:function(res){<br />                res=eval("("+res+")");<br />                addstatus=res['status'];<br />                addmsg=res['msg'];<br />                item.id=res['msg'];<br />            }<br />        });<br />    }<br />    if(addstatus==0){<br />        if(addmsg=='login'){<br />            showLogin();<br />        }else{<br />            $('.err_tag').text(addmsg);<br />            $('.err_tag').show();<br />            $("#ask-search-tag").flushCache();<br />        }<br />        return false;<br />    }<br />    var addhtml='<div><span>'+item.tagname+'</span><a href="javascript:;" data='+item.id+' class="t_rem" name="removetag"></a></div>';<br />    $("#ask-tags-item").append(addhtml);<br />    if((tagcount+1)==5){<br />        $("#ask-search-tag").hide();<br />    }<br />    $("#ask-tags-item a[name=removetag]").unbind('click').click(function(){<br />        removetag($(this));<br />    })<br />}<br />
Copy after login

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template