繁體
|
簡體
Sclub交友聊天~加入聊天室當版主
(檢舉)
分享
新浪微博
QQ空间
人人网
腾讯微博
Facebook
Google+
Plurk
Twitter
Line
標題:
[問題]
如何移動月曆的位置?
[打印本頁]
作者:
zxzyman
時間:
2012-8-30 15:08
標題:
如何移動月曆的位置?
如圖:
下載
(52.45 KB)
2012-8-30 15:06
這個月曆的代碼出現後 都會再右邊
如何把他移動到中間
--------------------------------------------
代碼:
<style>
.shd {style;border:1px dashed; border-color:blue;
color:white ;font:9pt Verdana;
background-color:black}
.shd2 { color:red ;font:9pt Verdana; }
.shd3 { colorrange ;font:9pt Verdana; }
.shd4 { color:green ;font:9pt Verdana; }
</style>
<script language="JavaScript">
function greeting(){
var today = new Date();
var hrs = today.getHours();
document.writeln("<TABLE width=220 cellSpacing=2 cellPadding=2 class=shd>");
document.write("<tr><td COLSPAN=7 align=center class=shd>");
if (hrs < 6)
document.write("(Early) Morning");
else if (hrs < 12)
document.write("早安!");
else if (hrs <= 18)
document.write("午安!");
else
document.write("晚安!");
document.writeln("<tr><td COLSPAN=7 align=center class=shd>");
dayStr = today.toLocaleString();
document.write(dayStr);
document.writeln("");}
function montharr(m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11){
this[0] = m0;
this[1] = m1;
this[2] = m2;
this[3] = m3;
this[4] = m4;
this[5] = m5;
this[6] = m6;
this[7] = m7;
this[8] = m8;
this[9] = m9;
this[10] = m10;
this[11] = m11;}
function calendar(){
var monthNames = "JanFebMarAprMayJunJulAugSepOctNovDec";
var today = new Date();
var thisDay;
var monthDays = new montharr(31, 28, 31, 30, 31, 30, 31, 31, 30,
31, 30, 31);
year = today.getYear();
thisDay = today.getDate();
if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0))
monthDays[1] = 29;
nDays = monthDays[today.getMonth()];
firstDay = today;
firstDay.setDate(1);
testMe = firstDay.getDate();
if (testMe == 2)
firstDay.setDate(0);
startDay = firstDay.getDay();
document.write("<TR><TD class=shd><FONT class=shd3>日<TD class=shd>一<TD class=shd>二<TD class=shd>三<TD class=shd>四<TD class=shd>五<TD class=shd><FONT class=shd4>六");
document.write("<TR>");
column = 0;
for (i=0; i<startDay; i++){
document.write("<TD>");
column++;}
for (i=1; i<=nDays; i++){
document.write("<TD class=shd>");
if (i == thisDay)
document.write("<FONT class=shd2>")
document.write(i);
if (i == thisDay)
document.write("")
column++;
if (column == 7){
document.write("<TR>");
column = 0;}}
document.write("</TABLE>");
document.writeln("");}
greeting();
document.write("");
calendar();
document.write("");
</script>
複製代碼
圖片附件:
huhu.JPG
(2012-8-30 15:06, 52.45 KB) / 下載次數 948
http://258club.com/discuz/attachment.php?aid=13918&k=f16477a317949bc435dfc88637b3fce5&t=1732435657&sid=XimSxP
作者:
沉默
時間:
2012-8-30 15:11
月历代码总感觉没必要放额。
作者:
tedstarry
時間:
2012-8-30 17:47
提示:
作者被禁止或刪除 內容自動屏蔽
作者:
gogo1266
時間:
2012-8-30 20:11
謝謝分享
歡迎光臨 SCLUB免費論壇申請-使用者論壇 (http://258club.com/discuz/)
Powered by Discuz! 7.2