自动打开弹出窗口,并使用javascript自动将其关闭
问题描述:
我正在创建一个页面以打开弹出窗口,我想在一个循环中单击一次以打开5个弹出窗口,并在一段时间后自动关闭所有弹出窗口,建议您提出解决方案
hi i am creating a page to open pop up i want to open 5 pop up on a click in a loop and automatically close all the pop up after a interval of time suggest your solution
答
<script type="text/javascript">
var win = window.open("http://www.google.com", "mywindow");
var interval;
function closePopup()
{
win.close();
clearInterval(interval);
}
interval=setInterval(closePopup,10000);
</script>
我认为这是一项常见的任务.还没谷歌吗?
I think this is a common task. Haven''t googled yet?