jquery-ui日历插件的使用步骤

来源:互联网 发布:大连交通大学软件学院 编辑:程序博客网 时间:2024/05/16 12:19


1.下载jquery-ui压缩包  ,解压导入项目中

2.引入需要的js与css

<!--这些都是必须的-->

<span style="color:#FF6666;"><link rel="stylesheet" href="<%=contextPath%>/resources/bootstrap/css/bootstrap.min.css" type="text/css"><link href="<%=contextPath%>/resources/js/jquery-ui-1.11.4/jquery-ui.min.css" rel="stylesheet" media="screen"> <script type="text/javascript" src="<%=contextPath%>/resources/js/jquery-1.9.1.min.js" charset="utf-8"></script><script type="text/javascript" src="<%=contextPath%>/resources/bootstrap/js/bootstrap.min.js" charset="utf-8"></script><script type="text/javascript" src="<%=contextPath%>/resources/js/jquery-ui-1.11.4/jquery-ui.min.js"></script><script type="text/javascript" src="<%=contextPath%>/resources/js/jquery-ui-1.11.4/datepicker-zh-CN.js"></script></span>
3.<input size="16" name="publishDate_b"  class="publishDate"    type="text"  value="${criterias.get("publishDate_b")}" /> 到<input size="16" name="publishDate_e"  class="publishDate"   type="text" value="${criterias.get("publishDate_e")}">4.//日期设置        $( ".publishDate" ).datepicker({              changeMonth: true,              changeYear: true,              dateFormat: "yy-mm-dd",              maxDate:new Date()        });

上图为效果图,浅蓝色的日期白色字的为不可选日期。

0 0
原创粉丝点击