MyNoteBook weblog

自作ソフトウェアや気になるものについて書いています

<< September 2008 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 >>

決断力


やっぱり、羽生さんて人はすごい人だな。
羽生さんだけじゃなくて、棋士って人たちは、自分の想像も及ばない世界で生きているんだな。
こういう世界があるってことが、すばらしいと思う。
| - | trackbacks (0)

JavaScriptでCSSを月ごとに切り替える

CSSを季節ごとに切り替えているが、手作業なのでできなかったりすることもある。
自動で切り替えられたら便利だろうなぁと思って、やり方を探してみた。
4galaxyに時間で変更する方法が載っていたので、改良してみた。
これで10月になると自動的に切り替わるので、お楽しみに・・・。
といっても、PCの日付を変えれば、いつでも変わるけど・・・。


■ヘッダー内のスクリプト
function getCSS()
{
datetoday = new Date();
timenow=datetoday.getTime();
datetoday.setTime(timenow);
theMonth = datetoday.getMonth()+1;

if (theMonth == 4)
display = "css/mynotebook1.css";
else if (theMonth == 5)
display = "css/mynotebook1.css";
else if (theMonth == 6)
display = "css/mynotebook1.css";
else if (theMonth == 7)
display = "css/mynotebook2.css";
else if (theMonth == 8)
display = "css/mynotebook2.css";
else if (theMonth == 9)
display = "css/mynotebook3.css";
else if (theMonth == 10)
display = "css/mynotebook6.css";
else if (theMonth == 11)
display = "css/mynotebook7.css";
else if (theMonth == 12)
display = "css/mynotebook4.css";
else if (theMonth == 1)
display = "css/mynotebook5.css";
else if (theMonth == 2)
display = "css/mynotebook5.css";
else if (theMonth == 3)
display = "css/mynotebook5.css";
else
display = "css/mynotebook1.css";
var css = '<'; css+='link rel="stylesheet" href=' + display + ' \/'; css+='>';
document.write(css);

}

■ボディ内のスクリプト
<script language="javascript">getCSS();</script>
<noscript>
<link rel="stylesheet" href="css/mynotebook1.css" type="text/css">
</noscript>
- | - | trackbacks (0)
CATEGORIES
NEW ENTRIES
RECOMMEND
【いちばんやさしい教える技術】…
いちばんやさしい教える技術

Book (発売日:2012-04-16)
【いままでのA面、B面ですと!?(通常盤)】…
いままでのA面、B面ですと!?(通常盤)

Music (発売日:2009-11-25)
RECENT TRACKBACK
ARCHIVES
PROFILE
OTHER