【问题标题】:Bootstrap-Year-Calendar showing all the months Vertically instead of HorizontallyBootstrap-Year-Calendar 垂直而不是水平显示所有月份
【发布时间】:2021-05-13 12:17:21
【问题描述】:

我已经实现了 Bootstrap-Year-Calendar 插件,但是它是垂直显示的,我不知道它是否与我的脚本或链接有任何关系。 我尝试更改我的 Jquery 和引导版本的版本,但结果是一样的。

我按照这些说明进行操作:http://www.bootstrap-year-calendar.com/#Documentation/Installation

这是我的代码:

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <!-- Bootstrap css-->

    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">

    <link rel="stylesheet" href="{{ static_url('css/bootstrap.min.css') }}">

    <!-- CUSTOM & PAGES STYLE -->
    <link rel="stylesheet" href="{{ static_url('css/custom.css') }}">


</head>

<body>

<div class="container">
<div data-provide="calendar" class="calendar">

    </div>      
</div>


<!-- Bootsrap -->
<script src="https://code.jquery.com/jquery-2.2.4.js" integrity="sha256-iT6Q9iMJYuQiMWNd9lDyBUStIq/8PuOW33aOqmvFpqI=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>

<link rel="stylesheet" href="{{ static_url('css/bootstrap-year-calendar.min.css') }}">
<script src="{{ static_url('js/bootstrap-year-calendar.min.js') }}"></script>

<script>
$(function() {
    $('#calendar').calendar();
});
</script>
</body>

</html>

这就是现在的样子

【问题讨论】:

  • 我也面临着垂直显示的同样问题。你能解决它吗?

标签: javascript html bootstrap-4


【解决方案1】:

这是因为您使用的是 bootstrap 4。Bootstrap-Year-Calendar 仅适用于 Bootstrap 3 版本。如果您不能在您的站点中使用 bootstrap3,则有一个为 BS4 定制的 fork

来自 fork 作者comment:- 他已经迁移了依赖于已弃用的 BS3 类的类,它应该可以工作。 BS4 不再使用 glyphicons,因此他使用 open-iconic 作为依赖项,因为它是他们推荐的图标来源之一 (https://getbootstrap.com/docs/4.0/extend/icons/)

【讨论】:

    猜你喜欢
    • 2011-12-22
    • 2017-09-09
    • 2017-07-09
    • 1970-01-01
    • 1970-01-01
    • 2021-01-18
    • 2020-08-26
    • 2020-03-08
    • 1970-01-01
    相关资源
    最近更新 更多