您目前尚未登陆,请选择【登陆】或【注册
首页->行政办公->科信客户关系管理系统源码>>images/birthday.js>>代码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:科信客户关系管理系统源码


当前文件路径:KeXinCrm/images/birthday.js 文件类型
普通视图
		            
1//日历 2var date_start,date_end,g_object 3var today = new Date(); 4var separator="-"; 5var inover=false; 6 7//mode :时间变换的类型0-年 1-月 2-直接选择月 8function change_date(temp,mode) 9{ 10 var t_month,t_year 11 if (mode){ 12 if(mode==1) 13 t_month=parseInt(cele_date_month.value,10)+parseInt(temp,10); 14 else 15 t_month=parseInt(temp) 16 if (t_month<cele_date_month.options(0).text) { 17 cele_date_month.value=cele_date_month.options(cele_date_month.length-1).text; 18 change_date(parseInt(cele_date_year.value,10)-1,0); 19 } 20 else{ 21 if (t_month>cele_date_month.options(cele_date_month.length-1).text){ 22 cele_date_month.value=cele_date_month.options(0).text; 23 change_date(parseInt(cele_date_year.value,10)+1,0); 24 } 25 else 26 {cele_date_month.value=t_month; 27 set_cele_date(cele_date_year.value,cele_date_month.value); 28 } 29 } 30 } 31 else{ 32 t_year=parseInt(temp,10); 33 34 if (t_year<cele_date_year.options(0).text) { 35 cele_date_year.value=cele_date_year.options(0).text; 36 set_cele_date(cele_date_year.value,1); 37 } 38 else{ 39 if (parseInt(t_year,10)>parseInt(cele_date_year.options(cele_date_year.length-1).text,10)){ 40 cele_date_year.value=cele_date_year.options(cele_date_year.length-1).text; 41 set_cele_date(cele_date_year.value,12); 42 } 43 else 44 {cele_date_year.value=t_year; 45 set_cele_date(cele_date_year.value,cele_date_month.value); 46 } 47 } 48 } 49 50 window.cele_date.focus(); 51 52} 53 54//初始化日历 55function init(d_start,d_end) 56{ 57 var temp_str; 58 var i=0 59 var j=0 60 date_start=new Date(1980,7,1) 61 date_end=new Date(2004,8,1) 62 document.writeln("<div name=\"cele_date\" id=\"cele_date\" style=\"display:none\" style=\"LEFT: 69px; POSITION: absolute; TOP: 159px;Z-INDEX:99\" onClick=\"event.cancelBubble=true;\" onBlur=\"hilayer()\" onMouseout=\"lostlayerfocus()\">-</div>"); 63 window.cele_date.innerHTML=""; 64 temp_str="<table border=\"1\" bgcolor=\"#DDDDDD\" bordercolor=\"white\"><tr><td colspan=7 onmouseover=\"overcolor(this)\">"; 65 temp_str+="<input type=\"Button\" value=\"<<\" onclick=\"change_date(-1,1)\" onmouseover=\"getlayerfocus()\" style=\"color: #000099; background-color: #BFBFBF; cursor: hand\">-"; 66 67 temp_str+="" 68 temp_str+="<select name=\"cele_date_year\" id=\"cele_date_year\" language=\"javascript\" onchange=\"change_date(this.value,0)\" onmouseover=\"getlayerfocus()\" onblur=\"getlayerfocus()\" style=\"font-size: 9pt; border: 1px #666666 outset; background-color: #F4F8FB\">" 69 70 for (i=1900;i<=2020;i++) 71 { 72 temp_str+="<OPTION value=\""+i.toString()+"\">"+i.toString()+"</OPTION>"; 73 } 74 temp_str+="</select>-"; 75 temp_str+="" 76 temp_str+="<select name=\"cele_date_month\" id=\"cele_date_month\" language=\"javascript\" onchange=\"change_date(this.value,2)\" onmouseover=\"getlayerfocus()\" onblur=\"getlayerfocus()\" style=\"font-size: 9pt; border: 1px #666666 outset; background-color: #F4F8FB\">" 77 78 for (i=1;i<=12;i++) 79 { 80 temp_str+="<OPTION value=\""+i.toString()+"\">"+i.toString()+"</OPTION>"; 81 } 82 temp_str+="</select>-"; 83 temp_str+="" 84 temp_str+="<input type=\"Button\" value=\">>\" onclick=\"change_date(1,1)\" onmouseover=\"getlayerfocus()\" style=\"color: #000099; background-color: #BFBFBF; cursor: hand\">"; 85 86 temp_str+="</td></tr><tr><td onmouseover=\"overcolor(this)\">" 87 temp_str+="<font color=red>7</font></td><td>";temp_str+="1</td><td>"; temp_str+="2</td><td>"; temp_str+="3</td><td>" 88 temp_str+="4</td><td>";temp_str+="5</td><td>"; temp_str+="6</td></tr>"; 89 for (i=1 ;i<=6 ;i++) 90 { 91 temp_str+="<tr>"; 92 for(j=1;j<=7;j++){ 93 temp_str+="<td name=\"c"+i+"_"+j+"\"id=\"c"+i+"_"+j+"\" style=\"CURSOR: hand\" style=\"COLOR:#000000\" language=\"javascript\" onmouseover=\"overcolor(this)\" onmouseout=\"outcolor(this)\" onclick=\"td_click(this)\">?</td>" 94 } 95 temp_str+="</tr>" 96 } 97 temp_str+="</td></tr></table>"; 98 window.cele_date.innerHTML=temp_str; 99} 100function set_cele_date(year,month) 101{ 102 var i,j,p,k 103 var nd=new Date(year,month-1,1); 104 event.cancelBubble=true; 105 cele_date_year.value=year; 106 cele_date_month.value=month; 107 k=nd.getDay()-1 108 var temp; 109 for (i=1;i<=6;i++) 110 for(j=1;j<=7;j++) 111 { 112 eval("c"+i+"_"+j+".innerHTML=\"\""); 113 eval("c"+i+"_"+j+".bgColor=\"#DDDDDD\""); 114 eval("c"+i+"_"+j+".style.cursor=\"hand\""); 115 } 116 while(month-1==nd.getMonth()) 117 { j=(nd.getDay() +1); 118 p=parseInt((nd.getDate()+k) / 7)+1; 119 eval("c"+p+"_"+j+".innerHTML="+"\""+nd.getDate()+"\""); 120 if ((nd.getDate()==today.getDate())&&(cele_date_month.value==today.getMonth()+1)&&(cele_date_year.value==today.getYear())){ 121 eval("c"+p+"_"+j+".bgColor=\"#EFFB64\""); 122 } 123 if (nd>date_end || nd<date_start) 124 { 125 eval("c"+p+"_"+j+".bgColor=\"#FF9999\""); 126 eval("c"+p+"_"+j+".style.cursor=\"text\""); 127 } 128 nd=new Date(nd.valueOf() + 86400000) 129 } 130} 131 132//s_object:点击的对象;d_start-d_end有效的时间区段;需要存放值的控件; 133function show_cele_date(eP,d_start,d_end,t_object) 134{ 135window.cele_date.style.display=""; 136window.cele_date.style.zIndex=99 137var s,cur_d 138var eT = eP.offsetTop; 139var eH = eP.offsetHeight+eT; 140var dH = window.cele_date.style.pixelHeight; 141var sT = document.body.scrollTop; 142var sL = document.body.scrollLeft; 143event.cancelBubble=true; 144window.cele_date.style.posLeft = event.clientX-event.offsetX+sL-5; 145window.cele_date.style.posTop = event.clientY-event.offsetY+eH+sT-5; 146if (window.cele_date.style.posLeft+window.cele_date.clientWidth>document.body.clientWidth) window.cele_date.style.posLeft+=eP.offsetWidth-window.cele_date.clientWidth; 147if (d_start!=""){ 148 if (d_start=="today"){ 149 date_start=new Date(today.getYear(),today.getMonth(),today.getDate()); 150 }else{ 151 s=d_start.split(separator); 152 date_start=new Date(s[0],s[1]-1,s[2]); 153 } 154}else{ 155 date_start=new Date(1900,1,1); 156} 157 158if (d_end!=""){ 159 s=d_end.split(separator); 160 date_end=new Date(s[0],s[1]-1,s[2]); 161}else{ 162 date_end=new Date(3000,1,1); 163} 164 165g_object=t_object 166 167cur_d=new Date() 168set_cele_date(cur_d.getYear(),cur_d.getMonth()+1); 169window.cele_date.style.display="block"; 170 171window.cele_date.focus(); 172 173} 174function td_click(t_object) 175{ 176var t_d 177if (parseInt(t_object.innerHTML,10)>=1 && parseInt(t_object.innerHTML,10)<=31 ) 178{ t_d=new Date(cele_date_year.value,cele_date_month.value-1,t_object.innerHTML) 179if (t_d<=date_end && t_d>=date_start) 180{ 181var year = cele_date_year.value; 182var month = cele_date_month.value; 183var day = t_object.innerHTML; 184if (parseInt(month)<10) month = "0" + month; 185if (parseInt(day)<10) day = "0" + day; 186 187g_object.value=year+separator+month+separator+day; 188window.cele_date.style.display="none";}; 189} 190 191} 192function h_cele_date() 193{ 194window.cele_date.style.display="none"; 195} 196 197function overcolor(obj) 198{ 199 if (obj.style.cursor=="hand") obj.style.color = "#FFFFFF"; 200 201 inover=true; 202 window.cele_date.focus(); 203 204} 205 206function outcolor(obj) 207{ 208 obj.style.color = "#000000"; 209 inover=false; 210 211} 212 213function getNow(o){ 214 var Stamp=new Date(); 215 var year = Stamp.getYear(); 216 var month = Stamp.getMonth()+1; 217 var day = Stamp.getDate(); 218 if(month<10){ 219 month="0"+month; 220 } 221 if(day<10){ 222 day="0"+day; 223 } 224 o.value=year+separator+month+separator+day; 225} 226 227function hilayer() 228{ 229 if (inover==false) 230 { 231 var lay=document.all.cele_date; 232 lay.style.display="none"; 233 } 234} 235function getlayerfocus() 236{ 237 inover=true; 238} 239function lostlayerfocus() 240{ 241 inover=false; 242} 243init(); 244//日历结束 245
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:科信客户关系管理系统源码

- 《用实例学ASP.NET》随书源码

- 成幻(CHSNS#)SNS1.22版源码

- TreeView+XML实现的菜单

- 三层小型论坛系统源码

- 简单实用的个人Blog站点源码

- cuteEditor6.0多语言版(集成..

- 云南旅游网全站源码

- 可以进行拖动的Asp.net购物车..

51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号