【问题标题】:Bootstrap datetimepicker icons not showing引导日期时间选择器图标未显示
【发布时间】:2018-02-27 06:34:12
【问题描述】:

我正在使用引导程序 3.x.x。并添加了 datetimepicker 4.17 , datetimepicker 工作正常,但不显示时钟图标和箭头图标。

https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js

https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/css/bootstrap-datetimepicker.min.css

我尝试了自定义图标,效果也很好。

icons: {
    time: 'glyphicon glyphicon-time',
    date: 'glyphicon glyphicon-calendar',
    up: 'glyphicon glyphicon-chevron-up',
    down: 'glyphicon glyphicon-chevron-down',
    //previous: 'glyphicon glyphicon-chevron-left',
    previous: 'glyphicon glyphicon-backward',
    next: 'glyphicon glyphicon-chevron-right',
    today: 'glyphicon glyphicon-screenshot',
    clear: 'glyphicon glyphicon-trash',
    close: 'glyphicon glyphicon-remove'
}

here

但默认图标没有显示。 我缺少什么请帮忙!

提前致谢。

【问题讨论】:

    标签: css twitter-bootstrap icons datetimepicker bootstrap-datetimepicker


    【解决方案1】:

    确保您还加载了 glyphicon 图标字体。 这可能是图标没有显示的原因。

    【讨论】:

    • 当我改变它的引导版本时。这意味着字形图标没有问题。谢谢
    • 如果我没记错的话,并非所有版本的 Bootstrap 都嵌入了 Glyphicon。尝试通过 CDN 链接 Glyphicon,看看是否能解决问题。
    【解决方案2】:

    在 bootstrap 4 中,我用字体图标替换了这些图标以使其正常工作:

     $(".timepicker").datetimepicker({
                icons:
                    {
                        up: 'fa fa-angle-up',
                        down: 'fa fa-angle-down'
                    },
                format: 'LT'
            });
    

    【讨论】:

      猜你喜欢
      • 2022-08-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多