首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >斯瓦尔的不当行为

斯瓦尔的不当行为
EN

Stack Overflow用户
提问于 2019-05-16 01:25:43
回答 1查看 19关注 0票数 0

每当我点击swal中的OK按钮时,后面的主网页就会变得没有响应。

代码语言:javascript
运行
复制
<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.
EN

回答 1

Stack Overflow用户

发布于 2019-06-26 17:24:39

代码语言:javascript
运行
复制
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();
});

尝试上面的代码。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56154704

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档