首页
精品建站
政府网站建设
企业网站建设
电商网站建设
手机网站建设
移动开发
微信公众号
微信商城
小程序
APP
互联网+服务
实战培训
成功案例
政府网站案例
企业网站案例
电商网站案例
门户网站案例
公司简介
联系我们
在下拉式的Form框中显示时间
发布时间:2008-12-19 14:46:00
阅读次数:
要完成此效果把如下代码加入到区域中
<script LANGUAGE="JavaScript"> //-------------------------------------------- // By mattias.sjoberg@swipnet.se 26/7-97 // The JavaScript Planet // http://www.geocities.com/SiliconValley/7116 // You're welcome to use/edit this script, // just keep the comments and drop me a note. //-------------------------------------------- today = new Date(); thismonth = today.getMonth() + 1; thisyear = today.getYear(); thisday = today.getDate(); maxdays=31;//default // months with 30 days if (thismonth==4 || thismonth==6 || thismonth==9 || thismonth==11) { maxdays=30 } // february, leap year if (thismonth==2) { // feb if ((thisyear/4)!=parseInt(thisyear/4)) { maxdays=28 } else { //leap year maxdays=29 } } thismonth = "" + thismonth if (thismonth.length == 1) { thismonth = "0" + thismonth; } for (var theday = 0; theday <= maxdays; theday++) { if (theday == 0) { document.write ("
"+ thisday + "-" + thismonth + "-" + thisyear ) document.write ("
========") } else { var thed = "" + theday if (thed.length == 1) { thed = "0" + thed; } document.write ("
" + thed + "-" + thismonth + "-" + thisyear) } } </script>
上一页:
时间显示在按钮上见过吗?
下一页:
一个显示停留时间的JS代码,并且可以加上提示信息
电话咨询
在线咨询
公司线路