【问题标题】:toastr js with SharePoint带有 SharePoint 的 toastr js
【发布时间】:2014-09-12 08:55:48
【问题描述】:

我正在尝试在 SharePoint 2013 中使用 toastr js 来显示通知。在我在 toastr 选项中添加 closebutton:true 之前,一切看起来都很棒。尽管标题、消息和关闭按钮的对齐方式发生了扭曲,但会出现关闭按钮。知道实施有什么问题吗?

带关闭按钮

没有关闭按钮

【问题讨论】:

    标签: javascript sharepoint-2013 toastr


    【解决方案1】:

    它发生在 SharePoint (core15.css) 为 button 声明 min-width 属性后:

    input[type=button], input[type=reset], input[type=submit], button {
       min-width: 6em;
    }
    

    解决方案

    CSS:

    button.toast-close-button {
      min-width: 0;
    }
    

    jQuery:

    $('button.toast-close-button').css('min-width',0);
    

    结果

    【讨论】:

      【解决方案2】:

      这很可能是 CSS 问题。我的猜测是您网站上的某些样式干扰了 toastr 中的样式。您应该能够通过检查 Chrome 开发工具(或您使用的任何浏览器工具)中的样式来检查 CSS,找到导致问题的样式(打开和关闭它们以提供帮助),然后创建一种新的样式来解决问题。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2016-04-30
        • 2013-05-09
        • 2013-01-15
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多