3 秒后关闭弹出窗口

新手上路,请多包涵

我需要在 3 秒后关闭以下弹出窗口。我该怎么做。

 <map id="ImgMap0" name="ImgMap0">
                  <area alt="" coords="127, 22, 20" alt="" title="click here" href="includes/popup1.htm" onclick="javascript:void window.open

('includes/popup1.htm','1366002941508','width=500,height=200,left=375,top=330');return false;" shape="circle" />
</map></p>

原文由 user964377 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 355
1 个回答

使用 setTimeout,例如:

 var win = window.open("http://www.google.com", '1366002941508','width=500,height=200,left=375,top=330');

setTimeout(function () { win.close();}, 3000);

示例小提琴:http: //jsfiddle.net/N5rve/

原文由 John Koerner 发布,翻译遵循 CC BY-SA 3.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题