javascript - 使用 SharePoint 的 toastr js

标签 javascript sharepoint-2013 toastr

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

带关闭按钮 With closed button

没有关闭按钮 without closed button

enter image description here

最佳答案

这是因为 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);

结果

enter image description here

关于javascript - 使用 SharePoint 的 toastr js,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25804391/

相关文章:

javascript - toastr.js : How to override default parameters for entire project

javascript - 表单验证时不会触发语义 UI onSuccess、onFailure 回调

javascript - 计算 RGB 颜色之间的褪色值的有效方法?

sharepoint - 如何在 Sharepoint 网站上查看我的权限级别

web-parts - 新文档按钮行为 SharePoint 2013

jquery - 验证用户对操作过滤器或授权过滤器的权限?

javascript - 对两个单独的元素应用相同的切换

javascript - 动画不适用于触摸事件?

c# - 如何在单独的类库中管理客户端上下文对象?

javascript - 使用 javascript 全局设置 toastr 选项