以下の内容はhttp://10plate.blog44.fc2.com/blog-entry-309.htmlより取得しました。


共有プラグイン 「今日の日付入りカレンダー」

カレンダーの上に今日の日付を表示する共有プラグインを登録しました。

これは現在閉鎖されたサイト様が共有プラグインとして登録していたものですが、そのサイト様のご意向により引き継ぎ登録しました。

以下、共有プラグイン「今日の日付入りカレンダー」のHTMLです。

<script type="text/javascript">
weeks = new Array("日","月","火","水","木","金","土") ;
today = new Date() ;
y = today.getFullYear() ;
m = today.getMonth() + 1 ;
d = today.getDate() ;
w = weeks[today.getDay()] ;
document.write (y,"/",m,"/",d,"(",w,")");
</script>

<br />
<div class="plugin-calender">
<table summary="カレンダー" class="calender">
<caption>
<a href="<%prev_month_link>"><%prev_month></a>
| <%now_year>/<%now_month> |
<a href="<%next_month_link>"><%next_month></a>
</caption>
<tr>
<th abbr="日曜日" scope="col" id="sun">日</th>
<th abbr="月曜日" scope="col">月</th>
<th abbr="火曜日" scope="col">火</th>
<th abbr="水曜日" scope="col">水</th>
<th abbr="木曜日" scope="col">木</th>
<th abbr="金曜日" scope="col">金</th>
<th abbr="土曜日" scope="col" id="sat">土</th>
</tr>
<!--calender-->
<tr>
<td><%calender_sun></td>
<td><%calender_mon></td>
<td><%calender_tue></td>
<td><%calender_wed></td>
<td><%calender_thu></td>
<td><%calender_fri></td>
<td><%calender_sat></td>
</tr>
<!--/calender-->
</table>
</div>


赤文字部が日付表示用のスクリプトタグです。
日付だけ表示したい場合は、赤文字部分以外を削除してください。

この今日の日付表示の色や大きさを変えたい場合は、以下のようなカスタマイズが出来ます。

【色を変更】
<font color="#○○○○○○">日付表示スクリプト</font>
※○○○○○○には色名の数字6桁を。
色選びはWebセーフカラー様が参考になります。

【センター(中央)寄せ】
<div align="center">日付表示スクリプト</div>

【色変更&中央寄せ】
<div align="center"><font color="#○○○○○○">日付表示スクリプト</font></div>

【色変更&フォントサイズ変更】
<font color="#○○○○○○" size="1">日付表示スクリプト</font>
※数値は1~7まで指定出来ますが、大きくしすぎるとデザイン崩れの原因になります。


今日の日付が表示されるカレンダーは暦の役割もしてくれるので便利そうです。
関連記事
[ 2009/09/17 19:49 ] 共有プラグイン | TB(0) | CM(9)



以上の内容はhttp://10plate.blog44.fc2.com/blog-entry-309.htmlより取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14