当前位置:首页 > 技术学堂 > 综合技术 > 正文 网页显示时间日期参数内容读取中请稍后...
站内搜索:
网页显示时间日期参数
您正浏览网页显示时间日期参数的详细内容 首页更多精彩 人气 ...

|奔日网技术学堂欢迎您 tech.8BR.NET|

 var headerColor = "midnightblue" // color of table's header
 var headerSize = "-1" // size of tables header font
 var colWidth = 50// width of columns in table
 var dayCellHeight = 10 // height of cells containing days of the week
 var dayColor = "ffae88" // color of font representing week days
 var cellHeight = 20// height of cells representing dates in the calendar
 var todayColor = "red" // color specifying today's date in the calendar
 var timeColor = "purple" // color of font representing current time

 // create basic table structure
 var text = "" // initialize accumulative variable to empty string
 text += '<CENTER>'
 text += '<TABLE BORDER=0'  + ' CELLSPACING=0'  + 'style="font-size: 9pt">' // table settings
 text +=  '<TH COLSPAN=7 HEIGHT=' + '>' // create table header cell
 text +=   '' // set font for table header
 
 text +=   '' // close table header's font settings
 text +=  '</TH>' // close header cell

 // variables to hold constant settings
 var openCol = '<TD WIDTH=' + colWidth + ' HEIGHT=' + dayCellHeight + '>'
 openCol += '<FONT COLOR="' + dayColor + '">'
 var closeCol = '</FONT></TD>'

 // create array of abbreviated day names
 var weekDay = new Array(7)
 weekDay[0] = "日"
 weekDay[1] = "一"
 weekDay[2] = "二"
 weekDay[3] = "三"
 weekDay[4] = "四"
 weekDay[5] = "五"
 weekDay[6] = "六"
 
 // create first row of table to set column width and specify week day
 text += '<TR bgcolor="black" ALIGN="center" VALIGN="center"  style="font-size: 9pt">'
 for (var dayNum = 0; dayNum < 7; ++dayNum) {
  text += openCol + weekDay[dayNum] + closeCol
 }
 text += '</TR>'
 
 // declaration and initialization of two variables to help with tables
 var digit = 1
 var curCell = 1
 
 for (var row = 1; row <= Math.ceil((lastDate + firstDay - 1) / 7); ++row) {
  text += '<TR ALIGN="right" VALIGN="top" style="font-size: 9pt">'
  for (var col = 1; col <= 7; ++col) {
   if (digit > lastDate)
    break
   if (curCell < firstDay) {
    text += '<TD></TD>';
    curCell++
   } else {
    if (digit == date) { // current cell represent today's date
     text += '<TD HEIGHT=1>'
     text += '<FONT COLOR="' + todayColor + '">'
     text += digit
     text += '</FONT><BR>'
     text += '<FONT COLOR="' + timeColor + '" SIZE=2 style="font-size: 9pt">'
     text += '<CENTER>' + '</CENTER>'
     text += '</FONT>'
     text += '</TD>'
    } else
     text += '<TD HEIGHT=' + cellHeight + '>' + digit + '</TD>'
    digit++
   }
  }
  text += '</TR>'
 }
 
 // close all basic table tags
 text += '</TABLE>'
 text += '</CENTER>'

 // print accumulative HTML string
 document.write(text)
}

// -->
</script>

本文共2页 当前在第2页 [首页] [上一页] [下一页] [末页] 

 发表对 网页显示时间日期参数 的评论  请文明聊天
|点此可收藏|或发表对本篇的评论

声明:此页资源均由网友维护。资源信息、网友评论,不代表本站观点。如有侵权请告知,我们立刻删除。

 艺术写真
 社会新闻
 极品飞车

『热点资讯』

『最新资讯』

『网友推荐』


百度搜索:
会员名称: 密码:匿名 注册 找回密码