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

Sweet alert JS library - modify animation speed

本文关键字:修改 动画 速度 JS 甜蜜      更新时间:2023-09-26

我想让甜蜜警报弹出的动画速度慢一点。我试着到处搜索,文档,网络,论坛,但没有那么成功。如何降低动画速度

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

迁移很简单,下面是迁移指南:从SweetAlert迁移到SweetAlert2

在SweetAlert2中,你可以通过覆盖show和hide类来改变动画速度:

Swal.fire({
  title: 'Custom animation speed',
  showClass: {
    popup: 'slow-animation-show'
  },
  hideClass: {
    popup: 'slow-animation-hide'
  }
})
.slow-animation-show {
  animation: swal2-show 3s; 
}
.slow-animation-hide {
  animation: swal2-hide 3s; 
}
<script src="//cdn.jsdelivr.net/npm/sweetalert2@11"></script>

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

 animation: animateSuccessTip 0.75s;

我认为你应该试着改变这个"s"(秒我猜)后缀的值。只需将其更改为一个高值,并检查它是否正确。