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有问题)
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控件

posted @ 2007-08-03 17:24  chenjunbiao  阅读(111)  评论(0编辑  收藏  举报