jQuery   发布时间:2022-04-19  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了jquery – 无法使用引导日期选择器大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我试图在输入区域添加 Bootstrap date picker,但我无法配置它:

我使用他们的demo page生成代码并尝试了它但似乎我遗漏了一些东西请帮我解决这个问题.

<!DOCTYPE html>
<html>
    <head>
        <title>Bootstrap</title>
        <Meta name="viewport" content="width=device-width,initial-scale=1.0">
        <link href="../files/css/bootstrap.min.css" rel="stylesheet">
        <link href="http://eternicode.github.io/bootstrap-datepicker/bootstrap-datepicker/css/datepicker3.css" rel="stylesheet">

        <script src="../files/js/jquery.min.js"></script>
        <script src="../files/js/bootstrap.js"></script>
        <script src="http://eternicode.github.io/bootstrap-datepicker/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
    </head>
    <body>
        <div class="input-group date">
            <input type="text" class="form-control"><span class="input-group-addon"><i class="glyphicon glyphicon-th"></i></span>
        </div>

<script>
    $('#sandBox-container .input-group.date').datepicker({
        format: "yyyy/mm/dd",startDate: "2012-01-01",endDate: "2015-01-01",todayBtn: "linked",autoclose: true,todayHighlight: true
        });
</script>
    </body>
</html>

我也试过使用这个链接cssjs

解决方法

在脚本上方移动脚本include标记,并从选择器中删除#sandBox-container – 它不存在.它之后工作(使用正确的URL)…

<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script src="http://cdnjs.cloudFlare.com/ajax/libs/bootstrap-datepicker/1.3.0/js/bootstrap-datepicker.js"></script>
<script>
    $('.input-group.date').datepicker({
        format: "yyyy/mm/dd",todayHighlight: true
    });
</script>

jsfiddle example…

大佬总结

以上是大佬教程为你收集整理的jquery – 无法使用引导日期选择器全部内容,希望文章能够帮你解决jquery – 无法使用引导日期选择器所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。