2016-11-21 93 views
1

我有我自己的下拉列表,我想加载Bootstrap Datepicker,并且在文档中找不到任何相关内容。有一个关于例子就是我想要做选择div在哪里加载Bootstrap Datepicker

这是怎么看我的HTML,在这里我要添加日期选择器

<div class="my-example"> 
    <input id="" placeholder="press to show calendar" class="input"> 
    <div class="dropdown"> 
    there is div, where I need to load my datepicker 
    </div> 
</div> 
+0

您想要将新的日期选择器或以前的日期选择器数据加载到带有下拉类的div中。 –

回答

2

添加一个div这样你就可以加载选择器我JSFiddle

<div class="dropdown"> 
    <div class="datetimepickerinline"> 
     there is div, where I need to load my datepicker 
    </div> 
</div> 

,然后锁定新的div(这样它就不会与引导下拉等冲突):

$('.datetimepickerinline').datetimepicker({inline: true}); 

使这项工作的关键是将inline属性设置为true

+0

谢谢!它效果很好:) –

+0

我很高兴帮助! – Stuart