0

每当我单击 swal 内的 OK 按钮时,后面的主网页就会变得无响应。

<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.
4

1 回答 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();
});

试试上面的代码。

于 2019-06-26T09:24:39.013 回答