答案:A VBS CLASS calendar
calendar.vbs
<%
'*************************************************************************************************
'VBScript 日历 组件
'
'赋值:
' Mnth 日历月份
' Yr 日历年份
' FontSize 字体大小
' Columns 月份显示列数
' FontFace 字体样式
' FontColour 字体颜色
' FillColour 星期背景颜色
' BorderColour 边框颜色
' BackgroundColour 日历背景颜色
' FullYearLink 全年月份连接
'
'取值:
' MonthCal 月份表格
' YearCal 年份表格
'方法:
' LoadMonthArray 私有方法
'*************************************************************************************************
%>
<Script LANGUAGE=javascript>
//定义整个年份查看连接函数
function showyearcal(link, year) {
if (link.indexOf('?') > 0)
link = link + '&year=' + year
else
link = link + '?year=' + year
calwin=window.open( link, 'calwin', '易做图=yes, scrollbars=yes, status=yes, width=680, height=480' )
if (typeof(calwin.focus) != "undefined") {
calwin.focus()
}
}
//定义月份查看连接函数
function changemonth(moveby) {
document.calform.calmonth.value = document.calform.calmonth.value - 0 + moveby;
document.calform.submit();
}
function changeyear(moveby) {
document.calform.calyear.value = document.calform.calyear.value - 0 + moveby;
document.calform.submit();
}
</script>
<style>
td.day {font-family:arial;font-size:8pt;color:black}
</style>
<%
'定义日历类
class calendar
private M, Y, D, WeekNo, MonthArray, FSize, FFace, FColour, BorderCol, FillCol, BGCol, BigCol, SingleMonth, FYLink, Cols, cStyleSheet
'声明私有变量
property let Mnth(Month)
if Month >= 1 and Month <= 12 then
M = Month
end if
end property
'给月份赋值
property let Yr(Year)
if Year > 1 and Year < 9999 then
Y = Int(Year)
end if
end property
'给年份赋值
property let FontSize(FS)
if FS >= 1 and FS <= 7 then
FSize = FS
end if
end property
'给字体大小赋值
property let Columns(C)
select case C
case 1,2,3,4,6,12
Cols = C
case else
Cols = 4
end select
end property
'给月份行数赋值
property let FontFace(FF)
if FF <> "" then
FFace = FF
end if
end property
'给字体样式赋值
property let FontColour(FC)
if FC <> "" then
FColour = FC
end if
end property
'给字体颜色赋值
property let FillColour(FC)
if FC <> "" then
FillCol = FC
end if
end property
'给星期背景色赋值
property let BorderColour(BC)
if BC <> "" then
BorderCol = BC
end if
end property
'给边框颜色赋值
property let BackgroundColour(BGC)
if BGC <> "" then
BgCol = BGC
end if
end property
'给日历背景色赋值
property let FullYearLink(FYL) FYLink = FYL end property
'给全年连接赋值
property let StyleSheet(SS) cStyleSheet = SS end property
'给样式赋值
'初始化日历类
private Sub Class_Initialize
Mnth = Month(Now)
Yr = Year(Now) '给年份赋值
FFace = "arial" '给字体样式赋值
FSize = 2 '给字体大小赋值
FColour = "black" '给字体颜色赋值
BorderCol = "lightgrey" '给边框颜色赋值
FillCol = "#3399FF" &n
上一个:为网页添加活动的背景音乐,可改为互动下啦菜单!
下一个:一个漂亮的互动式下拉菜单!