当前位置:首页 > 未命名

zblogphp如何让侧边的标签变成多彩标签

8976988823个月前 (01-10)未命名5

多彩标签看着更炫酷,下面看看本站的侧边效果吧!

是不是比原来的黑色的没有色彩的好看多了?设置方法走起!

第一步: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;}

第四步:进入网站后台 - 主题管理 - 启用主题就可以了。

扫描二维码推送至手机访问。

版权声明:本文由米表程序发布,如需转载请注明出处。

本文链接:https://www.9909999.xyz/post/528.html

分享给朋友: