您好,登錄后才能下訂單哦!
jqcloud是一個(gè)標(biāo)簽云的插件,先看例子,再看用法
下載地址:https://github.com/lucaong/jQCloud
解壓之后在/jqcloud/文件夾下面找到j(luò)qcloud.css 和 jqcloud-1.0.4.js
需要一個(gè)用來(lái)展示jqcloud的元素(div ,span等), 元素如果不指定寬和高,則需要在js中增加參數(shù)
至少需要指定每一項(xiàng)的text和weight,jqcloud會(huì)根據(jù)所有文字的權(quán)重,計(jì)算出合適的百分比。格式詳見(jiàn)代碼
text:展現(xiàn)的文字
weight:文字的權(quán)重
調(diào)用jQCloud函數(shù)(注意大小寫(xiě))
以下是jQCloud的參數(shù)
參數(shù) | 默認(rèn)值 | 作用 |
width | “” | 設(shè)置cloud的寬度,默認(rèn)是原來(lái)的寬度 |
height | “” | 設(shè)置cloud的高度,默認(rèn)是原來(lái)的高度 |
center | object | word在相對(duì)于cloud元素的x、y坐標(biāo),默認(rèn)是cloud元素的中心。 如 {x: 300, y: 150} |
afterCloudRender | “” | 在cloud呈現(xiàn)之后的回調(diào)函數(shù) |
delayedMode | true | 是否用延時(shí)模式。 如果設(shè)置為true,word會(huì)一個(gè)一個(gè)加載,每個(gè)之間會(huì)有微小的延時(shí)。 當(dāng)word超過(guò)50個(gè)的時(shí)候,默認(rèn)會(huì)是true |
shape | elliptic | cloud的形狀。支持 elliptic(橢圓形) 和 rectangular (矩形) 默認(rèn)是elliptic |
removeOverflowing | true | 如果設(shè)置為true, 如果一個(gè)word超出了cloud元素的大小,則自動(dòng)剔除 |
參數(shù)示例
{text: “ifxoxo.com”, weight: 13, link: {href: “http://ifxoxo.com/jquery-jqcloud.html”, target: “_blank”} }
{text: “520xmn.com”, weight: 10,html: {title: “My Title”, “class”: “custom-class”}}
{text: “520xmn.com”, weight: 15, handlers: {click: function(){alert(“from –ifxoxo.com”)}} }
如果對(duì)顏色和字體打大小不滿意,可以修改默認(rèn)的css文件–jqcloud.css
根據(jù)自己的需要,修改font-size 和 color
本文地址:http://ifxoxo.com/jquery-jqcloud.html
轉(zhuǎn)載請(qǐng)注明出處
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。