twitter-bootstrap Bootstrap 的日期选择器:嵌入式/内联
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19290280/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Datepicker for Bootstrap: Embedded / inline
提问by FrancescoMussi
I like very much datepicker for Bootstrap by Eternicode: https://github.com/eternicode/bootstrap-datepicker
我非常喜欢 Eternicode 的 Bootstrap 日期选择器:https: //github.com/eternicode/bootstrap-datepicker
I use his form to generate what i want to insert in my site: the calendar in the format Embedded/inline.
我使用他的表单来生成我想在我的网站中插入的内容:嵌入式/内联格式的日历。
As Jquery it is generated this code:
作为 Jquery,它生成了以下代码:
$('#sandbox-container div').datepicker({
format: "dd/mm/yyyy",
startDate: "now"
});
But as HTML it is generated only this code:
但作为 HTML,它只生成以下代码:
<div></div>
What HTML i have to put inside to have the calendar in Embedded/inline style? Thank you!
我必须在里面放入什么 HTML 才能使日历采用嵌入式/内联样式?谢谢!
回答by Alaa Badran
回答by Cyber
The actual fix is to give your Div and ID and reuse this id in your datepicker code:
实际的解决方法是给你的 Div 和 ID 并在你的日期选择器代码中重用这个 ID:
JS:
JS:
$('#sandbox-container').datepicker({
format: "dd/mm/yyyy",
startDate: "now"
});
html:
html:
<div id="sandbox-container"></div>
回答by Ashish
To put inside to have the calendar in Embedded/inline style. The html will be:<div id='sandbox-container'><div></div></div>
将日历放入嵌入式/内联样式。html 将是:<div id='sandbox-container'><div></div></div>

