Swal 行为不当

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

每当我点击 swal 中的“确定”按钮时,后面的主网页就会变得无响应。

<button id="myBtn" onclick="myFunction()">Click me</button>
function myFunction(){
  swal({
  title: "About Murli!",
  text: "Select the Month or Year, or both and then click on the Search button to get the list.",
  icon: "info",
  button: {
    text: "OK",
    value: true,
    visible: true,
    className: "",
    closeModal: true,
    closeOnClickOutside: true,
    closeOnEsc: true,
  },
  timer: 3000,
});
}````

The alert box opens correctly but after clicking on OK, the main page becomes unresponsive.
modal-dialog alert sweetalert
1个回答
0
投票
swal({
  title: "About Murli!",
  text: "Select the Month or Year, or both and then click on the Search button to get the list.",
  icon: "info",
  button: {
    text: "OK",
    value: true,
    visible: true,
    className: "",
    closeModal: true,
    closeOnClickOutside: true,
    closeOnEsc: true,
  },
  timer: 3000,
}).done(function(){
    swal.close();
});

尝试上面的代码。

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