dskvfdxgdo2422392 2018-08-09 11:49
浏览 90
已采纳

如何在x秒后停止运行Javascript函数? [重复]

This question already has an answer here:

I have a specific sweet alert on my website that I use for my div class that opens with onclick, but I want this onclick alert to stop after 60 seconds for example. So after 60 seconds the alert won't show up if I click the div.THis is what I got so far

<script type="text/javascript">
function JSalert(){
    swal("Error", "You have to watch the video first.", "error");
}
</script>


<div class="blocked" onclick="JSalert()">
</div>
  • 写回答

2条回答 默认 最新

      报告相同问题?

      相关推荐 更多相似问题

      悬赏问题

      • ¥20 有ASP .NET MVC做的小说阅读网站吗?
      • ¥20 beeline客户端支持ipv6地址连接hive服务
      • ¥15 香农解码的代码问题,无法输出解码结果
      • ¥15 Python操作注册表
      • ¥45 入门级别的一段VUE前端拍照像后端发送请求的代码,帮排错
      • ¥15 anaconda打开spyder后一直闪退,不知道怎么办
      • ¥15 解决迷宫问题中无法运行的问题
      • ¥15 关于aspnetcore中使用mqttnet库的entire
      • ¥15 关于#python#的问题,请各位专家解答!
      • ¥100 关于远控软件的两个问题