Last active
October 27, 2015 12:38
-
-
Save KurohimeAkari/10292d72bf35d151dc93 to your computer and use it in GitHub Desktop.
カテゴリー別な表示.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* none させなくても良いですが上に設置してると読み込むまで数値(1)などが表示されます。*/ | |
.hatena-module-category > .hatena-module-body > .hatena-urllist li a{ | |
display:none; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*----------------------------------------------------------- | |
// (C) Kurohime Akari + TMC45 INC様 | |
// Website: http://shioneko.sakura.ne.jp | |
// はてなブログ用 Blog Templates . Varsion 1.0.0 | |
// | |
// Comments: カテゴリー別に表示できるやつ。 | |
// | |
------------------------------------------------------------*/ | |
/*----------------------------------------------------------- | |
// http://tech.tmd45.jp/entry/2012/04/03/170348 様の改変 | |
------------------------------------------------------------*/ | |
$(function() { | |
//[ 表示させる数 ]----------------------------------------// | |
var arycase = ["css","about"]; | |
//------------------------------------------------------// | |
var categories = $(".hatena-module-category ul li a"); | |
$.each( | |
categories, | |
function(index, domEle) { | |
var ele = $(domEle); | |
var texts = $.trim(ele.text()); | |
ele.text(texts.replace(/\([^\(\s +]+\)/, '')); | |
// arycaseから文字列処理:matchしたものだけ表示 | |
for (var i = 0; i < arycase.length; i++) { | |
reg = new RegExp(arycase[i]); | |
if(texts.match(reg)){ | |
ele.fadeIn('slow').unbind(); | |
break; | |
} | |
}; | |
ele.attr("title", texts); | |
} | |
); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment