当前位置:首页-我的文档
{{number}}

我的文档

mnew主题添加彩色标签云
把以下代码添加到当前主题中的style.css文件:

  1. /*彩色标签*/  
  2. .tagcloud{  
  3. padding:14px 0 14px 12px;  
  4. }  
  5. .tagcloud a{  
  6. float:left;  
  7. margin:3px;  
  8. line-height:26px;  
  9. text-align:center;  
  10. border:1px solid #ddd;  
  11. border-radius:2px;  
  12. padding-top:0;  
  13. padding-right:5px;  
  14. padding-bottom:0;  
  15. padding-left:5px;  
  16. overflow:hidden;  
  17. display:block;  
  18. width:92px;  
  19. height:28px;  
  20. }  
  21. .tagcloud a{  
  22. color:#fff;  
  23. }  

js代码:

把以下代码放置到head.php或footer.php

  1. <script type="text/javascript">box_width = $("#cx_tag_cloud-5").width();  
  2. /*彩色标签*/  
  3. len = $(".tagcloud a").length - 1;  
  4. $(".tagcloud a").each(function(i) {  
  5.     var let = new Array('3366FF', '31ac76', 'ea4563', '31a6a0', '8e7daa', '4fad7b', 'f99f13', 'f85200', '666666');  
  6.     var random1 = Math.floor(Math.random() * 9) + 0;  
  7.     var num = Math.floor(Math.random() * 6 + 9);  
  8.     $(this).attr('style', 'background:#' + let[random1] + '');  
  9.     if ($(this).next().length > 0) {  
  10.         last = $(this).next().position().left  
  11.     }  
  12. });</script>