1月活动
快过年了,你们能够商量着去哪玩吧~
一、日历javascript
JANcss
FERhtml
MARjava
APR正则表达式
MAY编程
JUN浏览器
JUL性能
AUG优化
SEP动画
OCT
NOV
DEC
快过年了,你们能够商量着去哪玩吧~
<!DOCTYPE html PUBLIC "-//W3C//h2D XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/h2D/xhtml1-transitional.h2d"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>JavaScript简易日历 - 妙味课堂 - www.miaov.com</title> <style type="text/css"> * { padding: 0; margin: 0; } li { list-style: none; } body { background: #f6f9fc; font-family: arial; } .calendar { width: 210px; margin: 0 auto; padding: 10px 10px 20px 20px; background: #eae9e9; } .calendar ul { width: 210px; overflow: hidden; padding-bottom: 10px; } .calendar li { float: left; width: 58px; height: 54px; margin: 10px 10px 0 0; border: 1px solid #fff; background: #424242; color: #fff; text-align: center; cursor: pointer; } .calendar li h2 { font-size: 20px; padding-top: 5px; } .calendar li p { font-size: 14px; } .calendar .active { border: 1px solid #424242; background: #fff; color: #e84a7e; } .calendar .active h2 { } .calendar .active p { font-weight: bold; } .calendar .text { width: 178px; padding: 0 10px 10px; border: 1px solid #fff; padding-top: 10px; background: #f1f1f1; color: #555; } .calendar .text h2 {font-size: 14px; margin-bottom: 10px; } .calendar .text p { font-size: 12px; line-height: 18px; } </style> </head> <body> <div id="tab" class="calendar"> <ul> <li class="active"><h2>1</h2><p>JAN</p></li> <li><h2>2</h2><p>FER</p></li> <li><h2>3</h2><p>MAR</p></li> <li><h2>4</h2><p>APR</p></li> <li><h2>5</h2><p>MAY</p></li> <li><h2>6</h2><p>JUN</p></li> <li><h2>7</h2><p>JUL</p></li> <li><h2>8</h2><p>AUG</p></li> <li><h2>9</h2><p>SEP</p></li> <li><h2>10</h2><p>OCT</p></li> <li><h2>11</h2><p>NOV</p></li> <li><h2>12</h2><p>DEC</p></li> </ul> <div class="text"> <h2>1月活动</h2> <p>快过年了,你们能够商量着去哪玩吧~</p> </div> </div> <script type="text/javascript"> var innerText= [ "快过年了,你们能够商量着去哪玩吧~", "精通JavaScript开发课程 - 结课标准 - 有十条标准可以让你们修练成JS高手……", "妙味茶馆(bbs.miaov.com),正式开张,它看起来是论坛,实际上是个技术驿站,分红了五个版块:视频教程、妙味生活秀、特效兜儿、技术交流、妙味聊吧", "精通各类DOM类应用,熟练掌握面向对象编程思想(OOP)、熟悉JS面向对象开发方式 - 妙味课堂 - www.miaov.com", "熟练掌握AJAX技术及相关应用(例如:新浪微博级应用) - 妙味课堂 - www.miaov.com", "能够独立写出相似jQuery的小型库(支持各种选择符、事件类、DOM、自定义动画animate、AJAX……) - 妙味课堂 - www.miaov.com", "精通JS运动特效技术,能完整实现各种网站全部动画特效,如 妙味课堂 官网 - 妙味课堂 - www.miaov.com", "掌握JS调试及优化技术、能兼容全部浏览器 - 妙味课堂 - www.miaov.com", "精通JS事件对象及事件的工做机制,并能完成各种跨平台应用模块的开发 - 妙味课堂 - www.miaov.com", "能独立开发表现和性能都很优秀的RIA应用 - 妙味课堂 - www.miaov.com", "了解后台编程的相关知识,可以和后台工程师配合完成大型交互应用 - 妙味课堂 - www.miaov.com", "熟悉正则表达式的编写、应用及高级表单验证技术 - 妙味课堂 - www.miaov.com" ]; window.onload = function(){ var lis = document.getElementsByTagName("li"); var texts = document.getElementsByClassName("text"); for (var i = 0; i < lis.length; i++) { lis[i].index = i; lis[i].onmouseover = function(){ for (var i = 0; i < lis.length; i++) { lis[i].className = ""; } lis[this.index].className = "active"; texts[0].innerHTML = "<h2>"+(this.index+1)+"月活动</h2>" +"<p>"+innerText[this.index]+"</p>" ; } } } </script> </body> </html>
二、时间
<!DOCTYPE html><html><head><meta charset="utf-8"> <title>get时间</title></head><body><div><p id="p"> </p></div></body><script type="text/javascript"> window.onload = function(){ var p = document.getElementById("p"); show(); setInterval(show,1000); function toDouble(n){ if(n>10){ return n; }else{ return "0"+n; } } function getWeekDay(n){ switch(n){ case 0: return "星期日"; case 1: return "星期一"; case 2: return "星期二"; case 3: return "星期三"; case 4: return "星期四"; case 5: return "星期五"; case 6: return "星期六"; } } function show(){ var getdate = new Date; var year = getdate.getFullYear(); var month = getdate.getMonth()+1; var date = getdate.getDate(); var day = getdate.getDay(); var hour = getdate.getHours(); var minute = getdate.getMinutes(); var second = getdate.getSeconds(); p.innerHTML = year+"年"+month+"月"+date+"日"+getWeekDay(day)+"<br/>"+toDouble(hour)+"时"+toDouble(minute)+"分"+toDouble(second)+"秒"; }} </script></html>