Fuelux datepicker如何初始化它?

时间:2014-12-15 10:05:46

标签: javascript jquery datepicker fuelux

我尝试使用fuelux datepicker并且似​​乎无法正确初始化它!非常感激任何的帮助。我基于这里的示例:https://gist.github.com/vernak2539/9980566

页面标题:

<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">
<link href="//www.fuelcdn.com/fuelux/3.4.0/css/fuelux.min.css" rel="stylesheet">

HTML:

<div class="fuelux">
  <div class="datepicker dropdown" id="myDatepicker">
    <div class="input-append">
        <div class="dropdown-menu"></div>
        <input type="text" class="span2" value="" data-toggle="dropdown">
        <button type="button" class="btn" data-toggle="dropdown">
        <i class="icon-calendar"></i></button>
    </div>
</div>

在我的JS之前:

<!-- jQuery -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="//www.fuelcdn.com/fuelux/3.4.0/js/fuelux.min.js"></script>

JS:

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

也尝试了一个小提琴,并认为它就足够但它不起作用: http://jsfiddle.net/z2rpos9g/

1 个答案:

答案 0 :(得分:6)

看起来标记更重要

查看此FIDDLE

你也应该添加

fuelux

具有datepicker的div的类。