使用SharePoint的toastr js

时间:2014-09-12 08:55:48

标签: javascript sharepoint-2013 toastr

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

关闭按钮 With closed button

没有关闭按钮 without closed button

enter image description here

2 个答案:

答案 0 :(得分:2)

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

答案 1 :(得分:2)

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

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);

<强>结果

enter image description here