甜蜜警报JS库 - 修改动画速度

问题描述 投票:1回答:2

我想让Sweet Alert弹出窗口的动画速度慢一点。我试图在任何地方搜索,文档,网络,论坛,但没有那么多成功。如何降低动画速度?

javascript performance popupwindow sweetalert
2个回答
1
投票

原始的甜蜜警报插件不受支持,我建议你使用SweetAlert2插件。

迁移很简单,这是迁移指南:Migration from SweetAlert to SweetAlert2

在SweetAlert2中,您可以通过覆盖.swal2-show类来更改动画速度:

Swal.fire({
  title: 'Custom animation speed',
  customClass: 'slow-animation'
})
.slow-animation {
  animation: swal2-show 3s !important; 
}
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@8"></script>

0
投票

您是否尝试在quelltext中搜索以下代码:

 animation: animateSuccessTip 0.75s;

我认为您应该尝试更改具有此“s”(我猜的是秒)后缀的值。只需将其更改为高值并检查其是否正确。

© www.soinside.com 2019 - 2024. All rights reserved.