function funYearSelect() // 年份的下拉框{ var n = WebCalendar.yearFall; var e = WebCalendar.iframe.document.forms[0].tmpYearSelect; var y = isNaN(parseInt(WebCalendar.thisYear, 10)) ? new Date().getFullYear() : parseInt(WebCalendar.thisYear); y = (y <= 1000)? 1000 : ((y >= 9999)? 9999 : y); var min = (y - n >= 1000) ? y - n : 1000; var max = (y + n <= 9999) ? y + n : 9999; min = (max == 9999) ? max-n*2 : min; max = (min == 1000) ? min+n*2 : max; for (var i=min; i<=max; i++) e.options.add(new Option(i +"年", i)); e.style.display = ""; e.value = y; e.focus();}function funHourSelect() // 小时的下拉框{ var e = WebCalendar.iframe.document.forms[0].tmpHourSelect; var h = isNaN(parseInt(WebCalendar.thisHour, 10)) ? new Date().getHours() : parseInt(WebCalendar.thisHour); for (var i=0; i<=23; i++) e.options.add(new Option(appendZero(i) +"时", i)); e.style.display = ""; e.value = h; e.focus();}function funMinuteSelect() // 分钟的下拉框{ var e = WebCalendar.iframe.document.forms[0].tmpMinuteSelect; var mi = isNaN(parseInt(WebCalendar.thisMinute, 10)) ? new Date().getMinutes() : parseInt(WebCalendar.thisMinute); for (var i=0; i<=59; i++) e.options.add(new Option(appendZero(i) +"分", i)); e.style.display = ""; e.value = mi; e.focus();}function funSecondSelect() // 秒的下拉框{ var e = WebCalendar.iframe.document.forms[0].tmpSecondSelect; var s = isNaN(parseInt(WebCalendar.thisSecond, 10)) ? new Date().getSecondes() : parseInt(WebCalendar.thisSecond); for (var i=0; i<=59; i++) e.options.add(new Option(appendZero(i) +"秒", i)); e.style.display = ""; e.value = s; e.focus();}function prevM() // 往前翻月份{ WebCalendar.thisDay = 1; if (WebCalendar.thisMonth==1) { WebCalendar.thisYear--; WebCalendar.thisMonth=13; } WebCalendar.thisMonth--; writeCalendar();}function nextM() // 往后翻月份{ WebCalendar.thisDay = 1; if (WebCalendar.thisMonth==12) { WebCalendar.thisYear++; WebCalendar.thisMonth=0; } WebCalendar.thisMonth++; writeCalendar();}function prevH() // 往前翻小时{ WebCalendar.thisHour--; if(WebCalendar.thisHour==-1) { WebCalendar.thisHour=23; } writeCalendar();}function nextH() // 往后翻小时{ WebCalendar.thisHour++; if(WebCalendar.thisHour==24) { WebCalendar.thisHour=0; } writeCalendar();}function prevMi() // 往前翻小时{ WebCalendar.thisMinute--; if(WebCalendar.thisMinute==-1) { WebCalendar.thisMinute=59; } writeCalendar();}
function funYearSelect() // 年份的下拉框{ var n = WebCalendar.yearFall; var e = WebCalendar.iframe.document.forms[0].tmpYearSelect; var y = isNaN(parseInt(WebCalendar.thisYear, 10)) ? new Date().getFullYear() : parseInt(WebCalendar.thisYear); y = (y <= 1000)? 1000 : ((y >= 9999)? 9999 : y); var min = (y - n >= 1000) ? y - n : 1000; var max = (y + n <= 9999) ? y + n : 9999; min = (max == 9999) ? max-n*2 : min; max = (min == 1000) ? min+n*2 : max; for (var i=min; i<=max; i++) e.options.add(new Option(i +"年", i)); e.style.display = ""; e.value = y; e.focus();}function funHourSelect() // 小时的下拉框{ var e = WebCalendar.iframe.document.forms[0].tmpHourSelect; var h = isNaN(parseInt(WebCalendar.thisHour, 10)) ? new Date().getHours() : parseInt(WebCalendar.thisHour); for (var i=0; i<=23; i++) e.options.add(new Option(appendZero(i) +"时", i)); e.style.display = ""; e.value = h; e.focus();}function funMinuteSelect() // 分钟的下拉框{ var e = WebCalendar.iframe.document.forms[0].tmpMinuteSelect; var mi = isNaN(parseInt(WebCalendar.thisMinute, 10)) ? new Date().getMinutes() : parseInt(WebCalendar.thisMinute); for (var i=0; i<=59; i++) e.options.add(new Option(appendZero(i) +"分", i)); e.style.display = ""; e.value = mi; e.focus();}function funSecondSelect() // 秒的下拉框{ var e = WebCalendar.iframe.document.forms[0].tmpSecondSelect; var s = isNaN(parseInt(WebCalendar.thisSecond, 10)) ? new Date().getSecondes() : parseInt(WebCalendar.thisSecond); for (var i=0; i<=59; i++) e.options.add(new Option(appendZero(i) +"秒", i)); e.style.display = ""; e.value = s; e.focus();}function prevM() // 往前翻月份{ WebCalendar.thisDay = 1; if (WebCalendar.thisMonth==1) { WebCalendar.thisYear--; WebCalendar.thisMonth=13; } WebCalendar.thisMonth--; writeCalendar();}function nextM() // 往后翻月份{ WebCalendar.thisDay = 1; if (WebCalendar.thisMonth==12) { WebCalendar.thisYear++; WebCalendar.thisMonth=0; } WebCalendar.thisMonth++; writeCalendar();}function prevH() // 往前翻小时{ WebCalendar.thisHour--; if(WebCalendar.thisHour==-1) { WebCalendar.thisHour=23; } writeCalendar();}function nextH() // 往后翻小时{ WebCalendar.thisHour++; if(WebCalendar.thisHour==24) { WebCalendar.thisHour=0; } writeCalendar();}function prevMi() // 往前翻小时{ WebCalendar.thisMinute--; if(WebCalendar.thisMinute==-1) { WebCalendar.thisMinute=59; } writeCalendar();}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货