樂多的每月記事 - 部落格

Hedda avatar
By Hedda
at 2006-12-11T23:37

Table of Contents

也是下拉式選單
不過是用JavaScript寫的
使用方式只要把剛開始那幾行const變數的值改一改就可以了
function以下就不用管了

---
<script language="JavaScript">
const startYear = 2004; // 開始年份
const startMonth = 10; // 開始月份
const endYear = 2006; // 結束年份
const endMonth = 12; // 結束月份
const account = 'scchiang'; // 你的使用者名稱
const defaultString = '---'; // 一開始顯示的字串
const useChinese = 1; // 用中文就填1, 用英文就填0

function gotoMonthlyArchive(month)
{
if (month != "none") {
var url = "http://blog.roodo.com/" + account + "/archives/" +
month + ".html";
window.open(url, "_self", "");
}
}

const monthStr = ["January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"];
const monthNum = ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10",
"11", "12"];
var year = endYear;
var month = endMonth;
var i;

var output = '<select onChange="javascript:
gotoMonthlyArchive(this.value);">';
output += '<option value="none">' + defaultString + '</option>';
output += '<optgroup label="' + year + '">';

while ((year > startYear) || (year == startYear && month >= startMonth)) {
i = month - 1;
output += '<option value="' + year + '-' + monthNum[i] + '">';
if (useChinese) {
output += year + ' 年 ' + month + ' 月';
} else {
output += monthStr[i] + ', ' + year;
}
output += '</option>';
if (month == 1) {
month = 12;
year--;
output += '</optgroup>';
output += '<optgroup label="' + year + '">';
} else {
month--;
}
}

output += '</optgroup>';
output += '</select>';
document.write(output);

</script>

--

All Comments

天空的文章寫好了需要更新嗎?

Quintina avatar
By Quintina
at 2006-12-11T23:05
我之前是用yam樂多 合併之後不知道要怎麼弄,結果最後就變成天空的 可是現在寫了文章送出之後都不會立刻改變 是不是也有像以前一樣要做發佈更新的動作才行? -- For millions of years, In millions of homes. ...

樂多的每月記事

Genevieve avatar
By Genevieve
at 2006-12-11T22:04
※ 引述《honlo ()》之銘言: ※ 引述《chhuang (不要重複製造輪子)》之銘言: : 2. 自己寫的下拉式選單...貼在自由欄位... : 把 chhuang 改成你自己的 Blog ID 即可 : andlt;table style=and#34;WIDTH: 100%and#34; c ...

樂多的每月記事

Carol avatar
By Carol
at 2006-12-11T21:34
※ 引述《chhuang (不要重複製造輪子)》之銘言: : 2. 自己寫的下拉式選單...貼在自由欄位... : 把 chhuang 改成你自己的 Blog ID 即可 : andlt;table style=and#34;WIDTH: 100%and#34; cellspacing=and#34;1 ...

關於blogger文章使用圖片

Delia avatar
By Delia
at 2006-12-11T20:25
※ 引述《zh (夏天快來)》之銘言: : ※ 引述《NickEast (㊣ 尼克東 ㊣)》之銘言: : : 版上網友大多是flickr來放圖片,再外連到blogger中。 : : 相機拍的照片都想傳到flickr,一個月20mb的上傳空間,很寶貴。 : : 但是,有些小圖片(像是截圖),小弟覺得放在flic ...

無名blog中 回應紀錄的刪除

Margaret avatar
By Margaret
at 2006-12-11T19:32
請問一下各位高手 我在某台電腦連上無名blog後 有在某blog留回應 結果電腦自動記錄了我的姓名 在回應欄中的and#34;Nameand#34;這一項 只要用滑鼠連點兩下 就會出現我之前用來留言的名字 (有點像是google欄位會自動紀錄妳搜尋過哪些東西一樣....) 請問能夠把這項紀錄刪去嗎? ...