3秒后关闭弹出窗口 [英] Closing popup window after 3 seconds

查看:75
本文介绍了3秒后关闭弹出窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在3秒后关闭下面的弹出窗口。

I need to close the popup windows in the following after 3 seconds. How do I do it.

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


推荐答案

使用setTimeout,例如:

Use a setTimeout, for example:

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/

这篇关于3秒后关闭弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆