Skip to content

Instantly share code, notes, and snippets.

@Bunny-rabbit
Bunny-rabbit / calendar
Last active August 29, 2015 14:07
日历
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="http://g.tbcdn.cn/thx/cube/1.2.1/neat-min.css">
<style>
.calendar{width: 500px;height: 500px;border: 1px solid #000;display: none;position: absolute;top:24px;left: 0px;background: #fff;}
.calendar table{text-align: center;line-height: 42px;}
function randomColor(){
return "rgb("+Math.floor(Math.random()*255)+","+Math.floor(Math.random()*255)+","+Math.floor(Math.random()*255)+")";
}
function showBoxes(window) {
var rects = [];
function getRects(node){
var range = window.document.createRange();
range.setStartBefore(node);
range.setEndAfter(node);