...

View Full Version : Setting delay on popup window



darkwolfshadow
06-24-2004, 08:54 PM
I have a rollover graphic (gif image) on my site that, obviously, when rolled over will bring up a site related popup.
The problem is that the graphic is well placed to make the site look good, but it is so close to everything else that it gets annoying because it always get rolled over and I get the popup.

with the following script, I need to find a way of delaying the opening of the popup, (it already has a close delay as you can see). This may cause a little bit of trouble when it rolled over and the delay is such that customers think the it doesnt work. So, I need to also make it clickable to open the same popup.

(I KNOW WHAT I'M THINKING. JUST CANT PUT IT INTO WORDS).
The Script:

head:

<script Language="JavaScript">
<!-- //
word=new Array();
word[0]="<center>xxxxxxxxxxxxxxxtextxxxxxxxxxxxxxxxxxxx
<b>xxxxxxxtextxxxxxxxx</b>

xxxxxxxxtextxxxxxxx</b></br>
xxxxxtextxxxxxxx</br>
<b>xxxxxtextxxxx";

function popdef(n){
info=window.open("","info","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=n o,width=750,height=260")

info.document.open()
info.document.write("<html><head><title> Site Information</title></head><body color: #678096>")
info.document.write(word[n])
info.document.write("</body></html>")
info.document.close()
clearID=info.setTimeout("self.close()",4000)
return true;
}
// -->
// -->
</script>

Body:

<a href="javascript:opener.location='title.htm';window.close()"><img border="0" src="images/index/view_in_browser.gif" width="107" align="right" alt=""></a>

Again, thanks

adios
06-24-2004, 09:03 PM
Since you've (correctly) identified a potential source of annoyance for your users, why not just eliminate it altogether? :confused:

Roy Sinclair
06-24-2004, 09:59 PM
What Adios said. If you must still have the popup, why not use some other less prominent element to trigger it. If the popup just appears a few seconds after someone has moused over the logo they might not understand why it pops up.

danman
06-25-2004, 03:12 AM
But if for some reason you DO want the delay . . .
I think what you want is just to add this to the link tag:

onmouseover="setTimeout('popdef()',2000)"



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum