日期:2014-05-17  浏览次数:20864 次

jquery 日历控件
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>CSS Tables</title>
<link rel="stylesheet" type="text/css" href="GooCalendar/GooCalendar.css"/>
<script type="text/javascript" src="jquery-1.6.js"></script>
<script type="text/javascript" src="GooCalendar/GooCalendar.js"></script>
<script type="text/javascript" src="GooCalendar/GooFunc.js"></script>
<style type="text/css">

</style>
</head>

<script type="text/javascript">
var property={
 divId:"demo2",//日历控件最外层DIV的ID
 needTime:true,//是否需要显示精确到秒的时间选择器,即输出时间中是否需要精确到小时:分:秒 默认为FALSE可不填
 yearRange:[1970,2099],//可选年份的范围,数组第一个为开始年份,第二个为结束年份,如[1970,2030],可不填
 week:['日','一','二','三','四','五','六'],//数组,设定了周日至周六的显示格式,可不填
 month:['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月'],//数组,设定了12个月份的显示格式,可不填
 format:"yyyy-MM-dd hh:mm:ss"/*设定日期的输出格式,可不填*/
};
function ch(x)
{

$("#t_explain").parent().parent().toggle(500);
}

$(document).ready(function(){
var x=10;
var y=20;
canva=$.createGooCalendar("ks",property);
property.divId='demo1';
canva=$.createGooCalendar("js",property);
$("#ks").click(function(e){
$("#demo2").css({"top": (e.pageY+y)+"px",
"left": (e.pageX+x)+"px","position":"absolute"}).show("fast");
}).blur(function()
{
$("#demo2").hide();
}).focus(function(e)
{
$("#demo2").css({"top": (e.pageY+y)+"px",
"left": (e.pageX+x)+"px","position":"absolute"}).show("fast");
})


$("#js").click(function(e){
$("#demo1").css({"top": (e.pageY+y)+"px",
"left": (e.pageX+x)+"px","position":"absolute"}).show("fast");
}).blur(function()
{
$("#demo1").hide();
}).focus(function(e)
{
$("#demo1").css({"top": (e.pageY+y)+"px",
"left": (e.pageX+x)+"px","position":"absolute"}).show("fast");
})
$("#t_explain").parent().parent().toggle(500);

});
</script>
<body>
<table id="mytable" align="center" width="200" >
  <tr>
  <td colspan="2" align="center" valign="middle"><span class="STYLE1">计划/行动发布</span></td>
  </tr>
  <tr>
  <td width="118">类型:</td>
<td width="566" ><label>
<select name="select" onchange="ch(this.value)">
<option value="0">计划</option>
<option value="1">行动</option>
  </select>
</label></td>
  </tr>
  <tr>
  <td>开始时间:</td>
  <td><input type="text" value="" id="ks"/></td>