>
设为首页
>
收藏本站
>
最新电影
首页
运营资讯
今日英语
图形图像
计算机技术
Asp编程
网站结构化
资源共享
休闲娱乐
访问新站
您现在的位置:
首页
=>
后台技术
=>
脚本特效
=>
时间日期
订阅本栏目
日期输入控件4(黄色)
时间: 2007-10-31 16:25:14 阅读次数:3047
<!-- All Files Design & Write by Windy_sk, you can use it freely but ... YOU MUST KEEP THIS ITEM ! Email: flyhorses@sina.com HomePage: <A HREF="http://www.yeyoo.com" TARGET=_blank>http://www.yeyoo.com</A> or <A HREF="http://www.yeyoo.net" TARGET=_blank>http://www.yeyoo.net</A> --> <html> <head> <title>Agenda</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <style> BODY { FONT-SIZE: 9pt; PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px; } BR { FONT-SIZE: 9pt; height: 15pt; } TD { FONT-SIZE: 9pt; LINE-HEIGHT: 11pt; } input { FONT-SIZE: 9pt; height: 13pt; } input.normal { FONT-SIZE: 9pt; width: 35pt; height: 13pt; } </style> <script language="JavaScript1.2"> <!-- var ifDate = false; var Timer = new Date(); var years = Timer.getYear(); var months = (Timer.getMonth()+1); var days = Timer.getDate(); var weeks = Timer.getDay(); var Rec_List = ""; //Rec_List = ",20020202,20020608,20020815,20021219,20010125,20011105,2001706,20030715,20031203,20030416,"; function GetDays(the_year,the_month){ var Max_day = 31; if (the_month==4 || the_month==6 || the_month==9 || the_month==11){ Max_day = 30; }else if(the_month==2){ if(the_year%400==0){ Max_day = 29; }else if(the_year%100==0){ Max_day = 28; }else if(the_year%4==0){ Max_day = 29; }else{ Max_day = 28; } } return Max_day; } function ShowPlan(the_year,the_month,the_day){ var thisDate = the_year + "-" + (the_month+1) + "-" + the_day; selDate.value=thisDate; selDate.innerText=thisDate; LayerDate.style.visibility='hidden'; } function HideDate(){ if(LayerDate.style.visibility!='hidden' && !ifDate){ LayerDate.style.visibility='hidden'; ifDate = false; } } function Calendar(the_year,the_month){ var i = 0; var FontColor; var DateStr; var New_Date = new Date(the_year,the_month,1) var the_week = New_Date.getDay(); var Max_day = GetDays(the_year,the_month+1) var dummy = 7-(the_week+Max_day)%7; var Cal_str = ""; Cal_str += "<table align=center width=100% border=0 cellpadding=1 cellspacing=1 bgcolor=#FF9900>"; Cal_str += "<tr bgcolor=#ffcc99>"; Cal_str += "<td width=14% align=center>星期日</td>"; Cal_str += "<td width=14% align=center>星期一</td>"; Cal_str += "<td width=14% align=center>星期二</td>"; Cal_str += "<td width=14% align=center>星期三</td>"; Cal_str += "<td width=14% align=center>星期四</td>"; Cal_str += "<td width=14% align=center>星期五</td>"; Cal_str += "<td width=14% align=center>星期六</td>"; Cal_str += "</tr><tr>\n"; for(i=0;i<the_week;i++){ Cal_str += "<td valign=top align=center bgcolor=#ffffff onmouseout=this.bgColor='#ffffff' onmouseover=this.bgColor='#f2f8ff'> </td>\n"; } for(i=1;i<=Max_day;i++){ FontColor = ((i+the_week)%7==1||(i+the_week)%7==0)?"red":"black" DateStr = "," + the_year + (the_month<9?("0"+(parseInt(the_month)+1)):(parseInt(the_month)+1)) + (i<10?("0"+i):i) + ","; Cal_str += "<td valign=top align=center bgcolor=" + (Rec_List.search(DateStr)!=-1?"#FFCC33":"white") + ((i==days&&the_year==years&&the_month==months-1)?" background=image/now.gif":"") + " onmouseout=this.bgColor='" + (Rec_List.search(DateStr)!=-1?"#FFCC33":"#ffffff") + "' onmouseover=this.bgColor='#f2f8ff'>" Cal_str += "<a href=javascript:ShowPlan(" + the_year + "," + the_month + "," + i + ") style='color: " + FontColor + ";'>" + i + "</a></td>\n"; if((the_week+i)%7==0 && i!=Max_day) Cal_str += "</tr><tr>\n"; } if(dummy < 7){ for(i=1;i<=dummy;i++){ Cal_str += "<td valign=top align=center bgcolor=#ffffff onmouseout=this.bgColor='#ffffff' onmouseover=this.bgColor='#f2f8ff'> </td>\n"; } } Cal_str += "</tr></table>"; return(Cal_str); } function DateChange(mode){ var theYear=parseInt(ShowYear.innerText); var theMonth=parseInt(ShowMon.innerText); if(mode){ theMonth++; if(theMonth>=13){ theYear++; theMonth=1; } }else{ theMonth--; if(theMonth<=0){ theYear--; theMonth=12; } } ShowYear.innerText=theYear; ShowMon.innerText=theMonth; Cal_Tab.innerHTML=Calendar(theYear,theMonth-1); } function YearChange(){ var theYear; theYear=prompt("Please input the year: (0 - 3000)",ShowYear.innerText); if(theYear==null || theYear=="") return false; theYear=parseInt(theYear); theMon=parseInt(ShowMon.innerText); if((theYear+"a")=="NaNa" || theYear>3000 || theYear<0){ alert("输入错误!"); return false; }else{ ShowYear.innerText=theYear; ShowMon.innerText=theMon; Cal_Tab.innerHTML=Calendar(theYear,theMon-1); } setTimeout("LayerDate.style.visibility='visible'",10); } function MonChange(){ var theMon; theMon=prompt("Please input the Month: (1 - 12)",ShowMon.innerText); if(theMon==null || theMon=="") return false; theMon=parseInt(theMon); theYear=parseInt(ShowYear.innerText); if((theMon+"a")=="NaNa" || theMon>12 || theMon<1){ alert("输入错误!"); return false; }else{ ShowYear.innerText=theYear; ShowMon.innerText=theMon; Cal_Tab.innerHTML=Calendar(theYear,theMon-1); } setTimeout("LayerDate.style.visibility='visible'",10); } function runEg(){ var winEx=open(); winEx.document.open("text/html", "replace") winEx.document.write(Calendar(2002,7)); winEx.document.close(); } //runEg(); //--> </script> <script language="JavaScript" type="text/JavaScript"> <!-- function MM_reloadPage(init) { //reloads the window if Nav4 resized if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) { document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }} else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload(); } MM_reloadPage(true); //--> </script> </head> <body onClick="HideDate()"> <p align=center> </p> <p align=center> <input type=text id=selDate value="" style="width: 80px" disabled><input type=button value="q" style="FONT-SIZE: 7pt; FONT-FAMILY: 'Wingdings 3'; width: 15pt" onClick="ifDate=true;LayerDate.style.visibility=='hidden'?LayerDate.style.visibility='visible':LayerDate.style.visibility='hidden';return false"> </p> <div id="LayerDate" onMouseOver="ifDate=true" onMouseOut="ifDate=false" style="position:absolute; width:200px; height:115px; z-index:1; left: 269px; top: 54px; visibility: hidden; BORDER: 1 solid black;"> <table width="300" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td width="40" align="center" bgcolor="#000000" nowrap> <input type="button" value="|" style="FONT-FAMILY: 'Wingdings 3';width: 20px" onClick="DateChange(false)"></td> <td width="100%" align="center" bgcolor="#000000" style="color: white;FONT-WEIGHT: bold; CURSOR: default" nowrap><span id="ShowYear" onClick="YearChange()"></span> 年 <span id="ShowMon" onClick="MonChange()"></span> 月</td> <td width="40" align="center" bgcolor="#000000" nowrap><input type="button" value="}" style="FONT-FAMILY: 'Wingdings 3';width: 20px" onClick="DateChange(true)"> </td> </tr> <tr> <td colspan="3" align="center"> <span id="Cal_Tab"></span> </td> </tr> <tr> <td height=30 colspan="3" valign="middle" style="cursor: default" onClick="Cal_Tab.innerHTML=Calendar(years,months-1);ShowYear.innerText=years;ShowMon.innerText=months"><image src=image/now.gif height=12> <b>今天: <script>document.write(years + "-" + months + "-" + days)</script> </b> </td> </tr> </table> </div> <script language="JavaScript1.2"> ShowYear.innerText=years; ShowMon.innerText=months; Cal_Tab.innerHTML=Calendar(years,months-1); ShowPlan(years,(months-1),days); </script> </body> </html>
提示:您可以先修改部分代码再运行
站内搜索
:
标题
内容
下一篇
日期输入控件5(选择日期自动识别星期)
上一篇
日期输入控件
本栏目最新
栏目最新列表
符合标准的时间选择控件
js选择日期(可以选择开始结束时间)
带对勾的日期选择控件 蓝色
蓝色日历控件 只能选择日期
10秒倒计时的JS代码
网站优化策划
栏目最新列表
增加网站外链的快速方法
网站上线前必做的30个检查
新的友情链接参考标准(没有google的PR情况
优化Google的AdSense广告的五个工具
王通讲SEO八大基础
站点最新
站点最新列表
微博推广的一些技巧
xhEditor v1.1.7 发布,
收集的一些轻量级非常实
50个新鲜兼容最新版本的
javascript中cookie的设
Excel中出现#VALUE!、#D
jquery插件:飞飞表情插件
十个使用HTML5开发的精彩
支持HTML5的浏览器有哪些
飞妮莫属:漫画:如何写出
历史最热10条信息
AWStats安装QQ传真IP插件
MIME介绍 及
[
1
] [
2
] [
3
]
巧用Google和迅雷来下载
Transact SQL 常
[
1
] [
2
]
VIA Rhine II Fast Ethe
电脑常用端
[
1
] [
2
] [
3
]
Do you get a kick out
十道羊皮卷 欣赏+mp3版+
每日一句:A friend and
经典__悟透JavaScript
相关文章
日期输入控件
WEB打印设置 方案二
非常方便时间控件
日期输入控件2(日期
日期输入控件3(黑白
日期输入控件4(黄色
日期输入控件5(选择
时间控件6
时间控件7(梅花雨控
日期输入控件8
相关专题
相关专题列表
符合标准的时间选择控件
js选择日期(可以选择开始
带对勾的日期选择控件 蓝
蓝色日历控件 只能选择日
日期,时间选择输入控件
日期输入控件8
时间控件7(梅花雨控件)
时间控件6
日期输入控件5(选择日期
日期输入控件4(黄色)
伟哥博客
西安房产
123最新电影
三四六四
关于站点
|
免责声明
|
联系站长
|
网站地图
|
陕ICP备07002804号
WEB技术QQ交流群:72840059
©2007 ffasp.com. 版权所有