zblog教程 | 2020年03月24日13时29分26秒 | 评论:1
多彩标签看着更炫酷,下面看看本站的侧边效果吧!
第一步:zblog后台模块管理在相对应侧边添加标签;
第二步:在模板内添加JS代码给标签定义class属性;
<!--多彩标签--> <script> $(document).ready(function() { var tags_a = $("#divTags a"); tags_a.each(function(){ var x = 9; var y = 0; var rand = parseInt(Math.random() * (x - y + 1) + y); $(this).addClass("tags"+rand); }); }) </script> <!--多彩标签-->
第三步:在模板CSS文件添加颜色浮动;
#divTags .tags0 { background-color: #efac82; } #divTags .tags1 { background-color: #84c7cf; } #divTags .tags2 { background-color: #d69899; } #divTags .tags3 { background-color: #d59ad4; } #divTags .tags4 { background-color: #c9b070; } #divTags .tags5 { background-color: #475042b3; } #divTags .tags6 { background-color: #ff716a; } #divTags .tags7 { background-color: #4a64e2; } #divTags .tags8 { background-color: #62b360; } #divTags .tags9 { background-color: #ff7aa5; }
第四步:进入网站后台 - 主题管理 - 启用主题就可以了,觉得好看就快去试试吧,设置不成功的小伙伴可以联系爱站云付费操作哟!
相关文章
⎛⎝爱站云⎠⎞
AiZhanCloud.Com