asp.net之选择日期时如何关闭 Bootstrap 日期时间选择器
daizhj
阅读:76
2025-01-19 22:14:33
评论:0
我正在使用 Bootstrap 日期时间选择器 ( http://eonasdan.github.io/bootstrap-datetimepicker/Installing/ )。
当我选择日期时,选择器不会隐藏,我必须在外面单击才能关闭它。 选择/单击日期时如何关闭日期时间选择器?
<div class="col-sm-3">
<asp:TextBox ID="date2" class="form-control" runat="server"
onfocus="this.style.backgroundColor='yellow'"
onblur="this.style.backgroundColor='cyan'"/>
<script type="text/javascript">
$(function () {
$('#date2').datetimepicker();
});
</script>
</div>
请您参考如下方法:
您可以使用以下代码强制日期时间选择器隐藏自身。
$('#date2').data("DateTimePicker").hide();
对于 hide
等其他功能,请考虑查看 documentation .
声明
1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。