View Full Version : Close dhtmlwindow after x seconds

11-28-2008, 07:32 PM
1) Script Title: dhtmlwindow

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow/

3) Describe problem: No problem. Just asking. Is it possible to insert something like
setTimeout("self.close();",10000) to automatically close the window after a number of seconds?

I've tried the code above, but it doesn't seem to be working ...

11-30-2008, 02:28 AM
Sure. Take a look at the below:

<script type="text/javascript">

var googlewin=dhtmlwindow.open("googlebox", "iframe", "http://images.google.com/", "#1: Google Web site", "width=590px,height=350px,resize=1,scrolling=1,center=1", "recal")

setTimeout(function(){googlewin.close()}, 3000)