Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

opening popup html file while background file redirects to dif file

Status
Not open for further replies.

SPYDERIX

Technical User
Jan 11, 2002
1,899
CA
I have a blank html file called: index.html. I want its bgcolor="black" and I want it to
open a pop-up window size width=715 height=115 position left=149 top=311 with another html file called: logo.html.

At the same time I want index.html to re-direct users to page: main.html, but I want the popup window to stay open and have it be the selected window.

Below is what I have come up with so far (the index.html) file.

Can any-one help me with this?

<HTML>
<HEAD>
<TITLE></TITLE>
<SCRIPT LANGUAGE=&quot;JavaScript&quot;>
<!-- Begin
closetime = 0; // Close window after __ number of seconds?
// 0 = do not close, anything else = number of seconds
function Start(URL, WIDTH, HEIGHT) {
windowprops = &quot;left=149,top=311,width=&quot; + WIDTH + &quot;,height=&quot; + HEIGHT;
preview = window.open(URL, &quot;preview&quot;, windowprops);
if (closetime) setTimeout(&quot;preview.close();&quot;, closetime*1000);
}
function doPopup() {
url = &quot;LOGO.HTML&quot;;
width = 715; // width of window in pixels
height = 115; // height of window in pixels
delay = 0; // time in seconds before popup opens
timer = setTimeout(&quot;Start(url, width, height)&quot;, delay*1000);
}
// End -->
</SCRIPT>
<SCRIPT LANGUAGE=&quot;Javascript&quot;>
<!-- Begin
function reDirect() {
window.location=&quot;main.html&quot;
}
// End -->
</SCRIPT>
</HEAD>
<BODY BGCOLOR=&quot;BLACK&quot; onLoad=&quot;doPopup();reDirect()&quot;>
</BODY>
</HTML>
 
<BODY BGCOLOR=&quot;BLACK&quot; onLoad=&quot;doPopup();reDirect()&quot;>
should be
<BODY BGCOLOR=&quot;BLACK&quot; onLoad=&quot;doPopup(),reDirect()&quot;>
, not ;

That may help you.

Bob
 
Unfortunately that didn't work, in fact it works more often, when I leave, then semi-colon there instead of a comma.

Yes it works, but only sometimes, I need this thing to be efficeint, and work all the time.

My purpose, is so that when users come to site, they index.html pops up a banner telling them that the site is best viewed with Netscape that file is called: logo.html.
Then they get redirected by the index.html file to the main.html page, and users don't get hastled with having to close the banner every time they return to the main page, they see it once, close the window and shouldn't see it again unless they goto the index.html page again.

I am going to rewrite the popup and get rid of the delay effect that it has, maybe that is the problem.

Nate (0598792469)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top