您的位置:首页 > Web前端 > JQuery

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

2015-12-28 10:41 585 查看


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()
        });




上图为效果图,浅蓝色的日期白色字的为不可选日期。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: