2007年8月小记
1、判断当天是全年的第几周
public static int WeekOfTheYear()
{
//获取
System.Globalization.CultureInfo myCI = new System.Globalization.CultureInfo("zh-CN");
System.Globalization.Calendar myCal = myCI.Calendar;
//日期格式
System.Globalization.CalendarWeekRule myCWR = myCI.DateTimeFormat.CalendarWeekRule;
DayOfWeek myFirstDOW = myCI.DateTimeFormat.FirstDayOfWeek;
//本周为第myCal.GetWeekOfYear( DateTime.Now, myCWR, myFirstDOW )周
int thisWeek = myCal.GetWeekOfYear(DateTime.Now, myCWR, myFirstDOW);
return thisWeek;
}
2、一小段AlwaysVisible脚本(FF有问题){
//获取
System.Globalization.CultureInfo myCI = new System.Globalization.CultureInfo("zh-CN");
System.Globalization.Calendar myCal = myCI.Calendar;
//日期格式
System.Globalization.CalendarWeekRule myCWR = myCI.DateTimeFormat.CalendarWeekRule;
DayOfWeek myFirstDOW = myCI.DateTimeFormat.FirstDayOfWeek;
//本周为第myCal.GetWeekOfYear( DateTime.Now, myCWR, myFirstDOW )周
int thisWeek = myCal.GetWeekOfYear(DateTime.Now, myCWR, myFirstDOW);
return thisWeek;
}
var oldPosition = 0;
function flow() {
try {
var tmp = document.documentElement.scrollTop + document.documentElement.clientHeight - document.getElementById("master").offsetHeight;
if (tmp != oldPosition) {
document.getElementById("master").style.top = tmp;
oldPosition = tmp;
}
} catch(e) {
}
}
window.setInterval("flow()", 5);
最好使用ajaxToolkit的AlwaysVisibleControl控件function flow() {
try {
var tmp = document.documentElement.scrollTop + document.documentElement.clientHeight - document.getElementById("master").offsetHeight;
if (tmp != oldPosition) {
document.getElementById("master").style.top = tmp;
oldPosition = tmp;
}
} catch(e) {
}
}
window.setInterval("flow()", 5);