本文介绍了日历Javascript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道这个日历javascript:
http://www.javascriptkit.com/script/script2/eventscalendar.shtml [ ^ ]

当今天的日期与黄色突出显示的日期相同时,是否可以使用绿色(今天的日期)和黄色(活动的)以外的其他颜色?

I was wondering about this calendar javascript:
http://www.javascriptkit.com/script/script2/eventscalendar.shtml[^]

When today''s date is the same as the yellow highlighted date, is it possible to have another color than the green (date today) and yellow (activity)?

推荐答案

if ((todaysDay == x) && (todaysDate == daycounter) && (todaysMonth == monthNum)) {
	//add this if statement to check and see if it is an event today
    if (checkevents(daycounter,monthNum,yearNum,i,x))
    {
	// if true make the bgcolor what ever color you like other than green or yellow
	calendarString += ''<td align=\"center\" bgcolor=\"#9A45EE\" height=\"30\" width=\"40\"><a href=\"javascript:showevents('' + daycounter + '','' + monthNum + '','' + yearNum + '','' + i + '','' + x + '')\">'' + daycounter + ''<\/a><\/td>'';
    }
    else
    {
	calendarString += ''<td align=\"center\" bgcolor=\"#AAFFAA\" height=\"30\" width=\"40\"><a href=\"javascript:showevents('' + daycounter + '','' + monthNum + '','' + yearNum + '','' + i + '','' + x + '')\">'' + daycounter + ''<\/a><\/td>'';
    }
}
else	calendarString += ''<td align=\"center\" bgcolor=\"#FFFFC8\" height=\"30\" width=\"40\"><a href=\"javascript:showevents('' + daycounter + '','' + monthNum + '','' + yearNum + '','' + i + '','' + x + '')\">'' + daycounter + ''<\/a><\/td>'';
}



这篇关于日历Javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 01:02