Twitter Bootstrap DatePicker不工作 [英] Twitter Bootstrap DatePicker does not work

查看:122
本文介绍了Twitter Bootstrap DatePicker不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里开始使用以下html代码:

 < div class =input-append dateid =dp3data-date =12-02-2012data-date-format = dd-mm-yyyy> 
< input class =span2size =16type =textvalue =12-02-2012>
< span class =add-on>< i class =icon-th>< / i>< / span>
< / div>

在身体的末端附近,我称之为:

 < script src =../ js / bootstrap-datepicker.js>< / script> 
< script> $('#dp3')。datepicker(); < / scripts>
< / body>

我还包括以下



 < link href =../ css / datepicker.css =stylesheet> 

但是当我点击字段没有datepicker打开。


<如前所述,请确保你包含jQuery,并且在jQuery ready()函数中包装你的datepicker初始化,像这样:

  $(document).ready(function($){
$('#dp3')。datepicker();
});

在这里工作:
http://jsfiddle.net/rUa7M/


Sarting from here I use the following html code:

<div class="input-append date" id="dp3" data-date="12-02-2012" data-date-format="dd-mm-yyyy">
  <input class="span2" size="16" type="text" value="12-02-2012">
  <span class="add-on"><i class="icon-th"></i></span>
</div>

near the end of body I call this:

<script src="../js/bootstrap-datepicker.js"></script>
<script>$('#dp3').datepicker(); </script>
  </body>

I also include the following

<link href="../css/datepicker.css" rel="stylesheet">

But when I click on the field no datepicker is open.

解决方案

As mentioned previously, make sure you are including jQuery, and also wrap your datepicker initialization in the jQuery ready() function, like so:

$(document).ready(function($) {
  $('#dp3').datepicker();
});

See it working here: http://jsfiddle.net/rUa7M/

这篇关于Twitter Bootstrap DatePicker不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆