知更鸟begin主题自带的标签云样式修改,代码来自某人,修改的是5.4版本的,其它版本未测试,代码由js随机颜色加css样式修改而成。
css样式
- .tagcloud{
- padding:14px 0 14px 12px;
- }
- .tagcloud a{
- float:left;
- margin:3px;
- line-height:26px;
- text-align:center;
- border:1px solid #ddd;
- border-radius:2px;
- padding-top:0;
- padding-right:5px;
- padding-bottom:0;
- padding-left:5px;
- overflow:hidden;
- display:block;
- width:92px;
- height:28px;
- }
- .tagcloud a{
- color:#fff;
- }
js代码
- <script type="text/javascript">box_width = $("#cx_tag_cloud-5").width();
- len = $(".tagcloud a").length - 1;
- $(".tagcloud a").each(function(i) {
- var let = new Array('3366FF', '31ac76', 'ea4563', '31a6a0', '8e7daa', '4fad7b', 'f99f13', 'f85200', '666666');
- var random1 = Math.floor(Math.random() * 9) + 0;
- var num = Math.floor(Math.random() * 6 + 9);
- $(this).attr('style', 'background:#' + let[random1] + '');
- if ($(this).next().length > 0) {
- last = $(this).next().position().left
- }
- });</script>
css代码放主题样式表文件(style.css),js自己调用或添加到页脚文件,感谢爱都娱乐的代码。
- 我的微信
- 这是我的微信扫一扫
-
- 站长技术资源群
- QQ群:431710796
-
2018年5月20日 上午2:16
请留版权,谢谢
2018年5月20日 上午10:52
你谁啊?
2018年6月6日 下午2:43
文章谁的
:!:你的吗?