jqcloud是一个jQuery标签云的插件,如下图所示:
示例代码:
<!DOCTYPEhtml><html><head><title>jQCloudExample</title><linkrel="stylesheet"type="text/css"href="jqcloud.css"/><scripttype="text/javascript"src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script><scripttype="text/javascript"src="jqcloud-1.0.4.js"></script><scripttype="text/javascript">/*!*Createanarrayofwordobjects,eachrepresentingawordinthecloud*/varword_array=[{text:"Lorem",weight:15},{text:"Ipsum",weight:9,link:"https://jquery.com/"},{text:"Dolor",weight:6,html:{title:"Icanhazanyhtmlattribute"}},{text:"Sit",weight:7},{text:"Amet",weight:5}//...asmanywordsasyouwant];$(function(){//WhenDOMisready,selectthecontainerelementandcallthejQCloudmethod,passingthearrayofwordsasthefirstargument.$("#example").jQCloud(word_array);});</script></head><body><!--Youshouldexplicitlyspecifythedimensionsofthecontainerelement--><divid="example"style="width:550px;height:350px;"></div></body></html>
评论