 |
1樓
巨大八爪鱼
2010-10-27 23:41
var calendar=new Object(); calendar.module=new Object(); calendar.module.mouse=new Object(); calendar.left=new Object(); calendar.left.test=new Object(); calendar.left.test.gray=/color_gray/gi; calendar.date=function(){ return $_DOM('_cdate').innerHTML.replace(/月/gi,'').split('年'); } calendar.module.mouse.out=function(t,fx){ if (fx==0){ t.className='left'; }else if (fx==1){ t.className='right'; } } calendar.module.mouse.over=function(t,fx){ if (fx==0){ t.className='lefting'; }else if (fx==1){ t.className='righting'; } } calendar.module.mouse.click=function(fx){ this.url="../Ajax/board_module_calendar.php"; this.parameters="k="+$_DOM('boardid').value+"&f="+fx+"&ds="+$_DOM('_calendar_date').value; //参数 this.sunday=$_DOM('_calendar_date').value; //切换前的星期日日期(2010-10-25) this.mothed="post"; //提交方式 this.ajax=new Ajax.Request(this.url,{mothed:this,mothed:this.mothed,parameters:this.parameters,onComplete:this.returned}); } calendar.module.mouse.returned=function(q){ var dat,daf,cyear,span,j; var str=q.responseText.split('||'); //获取返回字符串并拆分 str[0]=str[0].split(','); //拆分各日期(周日到周六) var cdate=str[0][0].split('-'); //当前切换的星期日日期(10-25) $_DOM('_calendar_date').value=str[1]+'-'+cdate[0]+'-'+cdate[1]; //当前切换的星期日日期(2010-10-25) for (var i=0;i<str[0].length;i++){ span=$_DOM('calendar_module_listof'+i); span.innerHTML=str[0][i]; //更新表格第一列的日期 dat=span.innerHTML.split('-'); //显示的日期(10-25) daf=$_DOM('_calendar_defaultdate').value.split('-'); //当前日期(2010-10-25) //获取当前显示日期的年份 cyear=Number(str[1]); if (cdate[0]==12 && dat[0]==1){ //若为第二年 cyear+=1; } //将当前日期背景改为蓝色 span=$_DOM('calendar_module_tr'+i); for (j=0;j<3;j++) daf[j]=Number(daf[j]); for (j=0;j<2;j++) dat[j]=Number(dat[j]); if (daf[0]==cyear && daf[1]==dat[0] && daf[2]==dat[1]){ span.className='select'; }else{ span.className=''; } } $_DOM('rilicrrqi').innerHTML=str[1]+'年'+cdate[0]+'月'; //更新灰色标题栏年和月 } calendar.onload=function(){ this.left.update(); } calendar.left.update=function(){ var cd=calendar.date(); var span,a,m; var myDate=new Date(cd[0],cd[1]-1,1); var gd=myDate.getDay(); //获取这个月1日的星期数 if (gd==1) gd=8; var v=24*60*60*1000; var start_date=new Date(myDate-gd*v); var cdk=$_DOM('_cday').innerHTML.split(','); for (var i=0;i<42;i++){ a=start_date.getDate(); span=$_DOM('__'+String(i)); span.innerHTML=a; m=start_date.getMonth()+1; span.className=(cd[1]==m)?"":"color_gray"; //当前日高亮显示 if (start_date.getFullYear()==Number(cdk[0]) && m==Number(cdk[1]) && a==Number(cdk[2]) && (!this.test.gray.test(span.className))){ if (span.className==""){ span.className="istoday"; }else{ span.className+=" istoday"; } } span.onclick=function(){calendar.onclick(this.id);}; start_date=new Date(start_date-(-1)*v); } } calendar.onturnpage=function(ik){ var cd=calendar.date(); if (ik==1){ cd[1]--; if (cd[1]<1){ cd[1]=12; cd[0]--; } }else if (ik==2){ cd[1]++; if (cd[1]>12){ cd[1]=1; cd[0]++; } } var str=String(cd[0])+"年"+String(cd[1])+"月"; sed($_DOM('_cdate'),str); sed($_DOM('__cdate'),str); calendar.left.update(); } calendar.onclick=function(ik){ var span=$_DOM(ik); if (this.left.test.gray.test(span.className)){ this.onturnpage((Number(span.id.replace(/__/gi,''))<20)?1:2); }else{ } }

|
 |
2樓
巨大八爪鱼
2010-10-27 23:42
.board_rili img.icon { background-image: url(../Images/board/modIcon.gif); background-repeat: no-repeat; background-position: -12px -391px; height: 15px; width: 15px; } .board_rili div.title { margin-bottom: 6px; background-color: #E6E6E6; height: 17px; padding-top: 3px; } .board_rili div.mouse div.left { float: left; background-image: url(../Images/board/modIcon.gif); background-repeat: no-repeat; background-position: -36px -31px; height: 17px; width: 20px; cursor: pointer; } .board_rili div.contenthead { padding-top: 6px; } .board_rili div.mouse div.lefting { float: left; background-image: url(../Images/board/modIcon.gif); background-repeat: no-repeat; background-position: -56px -31px; height: 17px; width: 20px; cursor: pointer; } .board_rili div.mouse div.right { float: right; background-image: url(../Images/board/modIcon.gif); background-repeat: no-repeat; background-position: -36px -11px; height: 17px; width: 20px; cursor: pointer; } .board_rili div.mouse div.righting { float: right; background-image: url(../Images/board/modIcon.gif); background-repeat: no-repeat; background-position: -56px -11px; height: 17px; width: 20px; cursor: pointer; } #calendar_module_list tr { height: 19px; color: #808080; } #calendar_module_list tr.select { background-color: #D6E5F0; color: #0080FF; font-weight: bold; } .board_rili div.xline { margin-top: 4px; margin-right: 9px; margin-bottom: 6px; margin-left: 5px; } .board_rili div.openallrili { margin-right: 9px; margin-bottom: 3px; } .calendarpage #righthead { margin-top: 5px; } .calendarpage #righthead img { background-image: url(../Images/board/iconsp.png); background-repeat: no-repeat; height: 16px; width: 30px; cursor: pointer; } .calendarpage #righthead #a { background-position: -77px -124px; } .calendarpage #righthead #a.disabled { background-position: -77px -155px; } .calendarpage #righthead #b { background-position: -131px -124px; } .calendarpage #righthead #b.disabled { background-position: -131px -155px; } .calendarpage #righthead #d { float: left; } .calendarpage #righthead #e { float: right; } .calendarpage #righthead #e ul { list-style-type: none; margin-right: 2px; margin-top: 4px; } .calendarpage #righthead #e ul li { background-image: url(../Images/board/iconsp.png); background-repeat: no-repeat; background-position: -138px -18px; height: 16px; width: 40px; display: inline; margin-right: 1px; float: right; padding-top: 6px; cursor: pointer; text-align: center; color: #3B525D; } .calendarpage #righthead #e ul li.focus { background-position: -78px -18px; font-weight: bold; } .calendarpage #righttabledays { text-align: center; background-color: #B7D4F0; color: #1146BB; } .calendarpage #righttabledays td.roundtopleft{ background-image: url(../Images/board/iconsp.png); background-repeat: no-repeat; background-position: 0px -126px; } .calendarpage div.LB{ background-image: url(../Images/board/iconsp.png); background-repeat: no-repeat; background-position: 0px -126px; margin-top: 18px; font-weight: bold; margin-left: 6px; } .calendarpage #left1 { background-color: #B7D4F0; padding-top: 7px; margin-left: 4px; } .calendarpage #left1 #head { text-align: center; height: 17px; color: #1159BB; } .calendarpage #left1 #head img { margin-top: 2px; } .calendarpage #left1 #head #left { float: left; background-image: url(../Images/board/iconsp.png); background-repeat: no-repeat; background-position: -60px -311px; height: 11px; width: 7px; cursor: pointer; margin-left: 12px; } .calendarpage .LB #left1 #head #right { float: right; background-image: url(../Images/board/iconsp.png); background-repeat: no-repeat; background-position: -60px -343px; height: 11px; width: 7px; cursor: pointer; margin-right: 14px; } .calendarpage .LB #left1 #center { background-color: #B7D4F0; margin-left: -4px; font-weight: normal; padding-right: 4px; padding-left: 6px; } .calendarpage .LB #left1 #center #viewday { border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #A2C7DD; border-right-color: #A2C7DD; border-bottom-color: #FFFFFF; border-left-color: #A2C7DD; } .calendarpage .LB #left1 #center #viewday tr.cas td { cursor: pointer; } .calendarpage .LB #left1 #center .istoday { color: #FFFFFF; background-color: #99AABB; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #2A2E33; border-left-color: #2A2E33; border-right-color: #AABBCC; border-bottom-color: #AABBCC; } .calendarpage .LB #left1 #foot { height: 9px; } .calendarpage .LB #left1 #leftroundhorn { background-image: url(../Images/board/iconsp.png); background-repeat: no-repeat; background-position: 0px -149px; height: 9px; width: 4px; margin-left: -4px; } .calendarpage #showtagslink { margin-top: 7px; margin-left: 6px; }

|