Skip to content

Commit

Permalink
fix: labels's background color 标签背景色
Browse files Browse the repository at this point in the history
  • Loading branch information
MOxFIVE committed Feb 27, 2016
1 parent d0167eb commit dd1c3a8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 20 deletions.
7 changes: 7 additions & 0 deletions source/js/main.js
Expand Up @@ -149,4 +149,11 @@ require([], function (){
$("#container .left-col .overlay").css({"background-color": colorList[id],"opacity": .3});
//移动端
$("#container #mobile-nav .overlay").css({"background-color": colorList[id],"opacity": .7});

var tags = $(".tagcloud a");
for(var i = 0; i < tags.length; i++){
var num = parseInt(4*Math.random()) + 1;
tags.eq(i).addClass("color" + num);
};
$(".article-category a:nth-child(-n+2)").attr("class", "color5");
});
10 changes: 0 additions & 10 deletions source/js/mobile.js
Expand Up @@ -129,16 +129,6 @@ define([], function(){
}, false);
};

var resetTags = function(){
var tags = $(".tagcloud a");
tags.css({"font-size": "12px"});
for(var i=0,len=tags.length; i<len; i++){
var num = tags.eq(i).html().length % 5 +1;
tags[i].className = "";
tags.eq(i).addClass("color"+num);
}
}

return{
init: function(){
//构造函数需要的参数
Expand Down
10 changes: 0 additions & 10 deletions source/js/pc.js
Expand Up @@ -17,16 +17,6 @@ define([], function(){
}
})();

var resetTags = function(){
var tags = $(".tagcloud a");
tags.css({"font-size": "12px"});
for(var i=0,len=tags.length; i<len; i++){
var num = tags.eq(i).html().length % 5 +1;
tags[i].className = "";
tags.eq(i).addClass("color"+num);
}
}

var slide = function(idx){
// 修复IE10+切换无效的bug
var $wrap = $(".switch-wrap"),
Expand Down

1 comment on commit dd1c3a8

@MOxFIVE
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert : c01b544

Please sign in to comment.