爱易网
IT新闻
IT新闻
爱易资讯
网站搭建
云虚拟主机教程
云服务器教程
Apache教程
IIS教程
Nginx教程
网站策划
站长文章
推广教程
淘宝客教程
网页设计
HTML教程
XHTML教程
CSS教程
HTML5教程
CSS3教程
JavaSript基础
JQuery教程
Node.js教程
前端技术
Ajax教程
Js特效
Xml教程
平面设计
页面UI设计
photoshop教程
程序开发
AI人工智能
Asp教程
Php教程
Asp.Net教程
Net Core教程
C#教程
Java教程
Jsp教程
开发技术
微信小程序教程
Uniapp开发教程
微信公众号开发
Andriod教程
IOS教程
DOS教程
Python教程
Docker教程
Windows Container教程
数据库
MSSQL教程
MySQL教程
Redis教程
Access教程
Oracle教程
数据库教程
操作系统
Linux教程
Windows教程
MAC教程
Cisco教程
交换机教程
防火墙教程
搜索
爱易网页
JS特效
一个表单日期输入的JS脚本 非常实用
一个表单日期输入的JS脚本 非常实用
日期:2014-05-18 浏览次数:20226 次
欢迎光临爱易网网页脚本特效中心,点击运行按钮演示特效:
以下是程序代码
<script language=javascript> var DS_x,DS_y; function dateSelector() //构造dateSelector对象,用来实现一个日历形式的日期输入框。 { var myDate=new Date(); this.year=myDate.getFullYear(); //定义year属性,年份,默认值为当前系统年份。 this.month=myDate.getMonth()+1; //定义month属性,月份,默认值为当前系统月份。 this.date=myDate.getDate(); //定义date属性,日,默认值为当前系统的日。 this.inputName=''; //定义inputName属性,即输入框的name,默认值为空。注意:在同一页中出现多个日期输入框,不能有重复的name! this.display=display; //定义display方法,用来显示日期输入框。 } function display() //定义dateSelector的display方法,它将实现一个日历形式的日期选择框。 { var week=new Array('日','一','二','三','四','五','六'); document.write("<style type=text/css>"); document.write(" .ds_font td,span { font: normal 12px 宋体; color: #000000; }"); document.write(" .ds_border { border: 1px solid #000000; cursor: hand; background-color: #DDDDDD }"); document.write(" .ds_border2 { border: 1px solid #000000; cursor: hand; background-color: #DDDDDD }"); document.write("</style>"); document.write("<input style='text-align:center;' id='DS_"+this.inputName+"' name='"+this.inputName+"' value='"+this.year+"-"+this.month+"-"+this.date+"' title=双击可进行编缉 ondblclick='this.readOnly=false;this.focus()' onblur='this.readOnly=true' readonly>"); document.write("<button style='width:60px;height:18px;font-size:12px;margin:1px;border:1px solid #A4B3C8;background-color:#DFE7EF;' type=button onclick=this.nextSibling.style.display='block' onfocus=this.blur()>选择日期</button>"); document.write("<div style='position:absolute;display:none;text-align:center;width:0px;height:0px;overflow:visible' onselectstart='return false;'>"); document.write(" <div style='position:absolute;left:-60px;top:20px;width:142px;height:165px;background-color:#F6F6F6;border:1px solid #245B7D;' class=ds_font>"); document.write(" <table cellpadding=0 cellspacing=1 width=140 height=20 bgcolor=#CEDAE7 onmousedown='DS_x=event.x-parentNode.style.pixelLeft;DS_y=event.y-parentNode.style.pixelTop;setCapture();' onmouseup='releaseCapture();' onmousemove='dsMove(this.parentNode)' style='cursor:move;'>"); document.write(" <tr align=center>"); document.write(" <td width=12% onmouseover=this.className='ds_border' onmouseout=this.className='' onclick=subYear(this) title='减小年份'><<</td>"); document.write(" <td width=12% onmouseover=this.className='ds_border' onmouseout=this.className='' onclick=subMonth(this) title='减小月份'><</td>"); document.write(" <td width=52%><b>"+this.year+"</b><b>年</b><b>"+this.month+"</b><b>月</b></td>"); document.write(" <td width=12% onmouseover=this.className='ds_border' onmouseout=this.className='' onclick=addMonth(this) title='增加月份'>></td>"); document.write(" <td width=12% onmouseover=this.className='ds_border' onmouseout=this.className='' onclick=addYear(this) title='增加年份'>>></td>"); document.write(" </tr>"); document.write(" </table>"); document.write(" <table cellpadding=0 cellspacing=0 width=140 height=20 onmousedown='DS_x=event.x-parentNode.style.pixelLeft;DS_y=event.y-parentNode.style.pixelTop;setCapture();' onmouseup='releaseCapture();' onmousemove='dsMove(this.parentNode)' style='cursor:move;'>"); document.write(" <tr align=center>"); for(i=0;i<7;i++) document.write(" <td>"+week[i]+"</td>"); document.write(" </tr>"); document.write(" </table>"); document.write(" <table cellpadding=0 cellspacing=2 width=140 bgcolor=#EEEEEE>"); for(i=0;i<6;i++) { document.write(" <tr align=center>"); for(j=0;j<7;j++) document.write(" <td width=10% height=16 onmouseover=if(this.innerText!=''&&this.className!='ds_border2')this.className='ds_borde
上一篇:狡猾的按钮特效
下一篇:非常实用的作为表单输入日期选择的特效
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
NEC拟出售移动效劳子公司NEC Mobile
华为坚持不上市究竟为何?不差钱也不想冒风险
传苹果已告知鸿海:两款新iPhone下月发货
途牛旅游网今晚挂牌纳斯达克 融资1亿美元
360涉足搜索范围 百度市场份额面临应战
《归来》遭视频网盗播 乐视网状告小米盒子侵权
猎豹移动上市押海外市场 与小米有合作空间
FDD牌照12月将发放 联通电信双4G反击中移动
传陌陌或12月赴美IPO 估值约30亿美元
推荐阅读
更多>
工商下月将整治手机市场
苹果多色彩!葫芦里究竟卖的什么药
同程旅游融资后变土豪 如何烧钱占领市场?
苹果音乐效劳新战略:与唱片商停止流媒体协作
工信部或本月17日向联通电信颁发FDD牌照
移动联通回应税率改革:短期内收入利润将大减
2019双12阿里云老用户怎么参加拼团活动 老用户拼团方法
新一代iPhone11月底国内上市 支持TD制式
陈天桥之鉴:产品创新被扼杀那些事
苹果股价突破100美元大关:投资者看好iPhone 6
解析2014年阿里百度等五大互联网巨头深度布局
微信企业号必须搬走四座大山,否则只能铩羽而归!
创维冲击500亿梦想:转型硬件和内容供应商
让一让,小米4来了,碰见米粉请务必绕道走!
第二梯队也PK:当1号店“遇上”京东手机节
玩游戏式的趣味戒烟App:Kwit
网络视频的几大趋势将成视频玩家躲不开的发力点
清点:罗永浩推锤子ROM 小米打法遭模拟
三星维修新规:Galaxy S4主板进水也收费修
打车App就是下一个团购骗局!?