运行代码 缩小
汉王
HTML代码
复制 格式化 注释 注释 清空
放大
AخA
 
1
<!DOCTYPE HTML>
2
<html>
3
<head>
4
<meta charset="utf-8">
5
<title>自己写的js日历</title>
6
<style>
7
*{margin:0; padding:0;}
8
ul,li{list-style:none;}
9
body{font-weight:bold; font-family:"微软雅黑", "新宋体", serif, arial;}
10
#calendar{width:280px; overflow:hidden; border:1px solid #dadada; position:absolute; left:50%; top:50%; margin-left:-141px; margin-top:-141px; border-radius:3px;}
11
.c_header{width:100%; height:60px; background-color:#83d8e7; background-image:linear-gradient(to bottom, #abe5ef, #83d8e7); position:relative;}
12
.c_header h1{font-size:16px; height:30px; line-height:30px; text-align:center; color:#ffffff;}
13
.c_header span{width:20px; height:20px; line-height:20px; color:#ffffff; text-align:center; position:absolute; top:5px; border-radius:50%; background-image:linear-gradient(to bottom, #83d8e7, #abe5ef); cursor:pointer;}
14
.c_header span:hover{background:#83d8e7;}
15
.c_header span.pre{left:10px;}
CSS代码
复制 格式化 注释 注释 颜色 清空
放大
CSS代码...
x
 
1
JS代码
复制 格式化 注释 注释 清空
放大
JS代码...
xxxxxxxxxx
1
 
1
名称
兴奋中^,自己写的JS小日历代码
分类
日期时间
描述
水平有限,希望高手勿笑!这个小日历完全是用Js写成的,没有使用jquery插件,暂时没有加入年份选择功能,虽然不是完美的,但至少可以用了,放在博客里还是不错的,高手们可拿去改进了,分享给喜欢JS的朋友们。
收藏