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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

self centering / sizing window

Status
Not open for further replies.

craigey

Technical User
Apr 18, 2002
510
GB
Hi,

I'm trying to create a self centering / sizing window. Which in itself is not particularly difficult. Except that I would like main page to do the above, but not a pop-up).

I really would prefer not to have the Maint2.html open at all I only want a small window to appear to show the Text in Maint.html, the only problem is that I'm using a script to do a tree directory menu, and so it requires a link to be clicked on to open the Maintenance page. The link cannot be edited, but all links open in a new page by default.


Sorry I know it's a pain, but I can't edit some of the already written code, as It's the works intranet. They don't like people playing with their code!

The code I have is
Maint.html
Code:
<TITLE>The simplest HTML example</TITLE>
<H1>Details here</H1>
<H2>More Details here</H2>

Maint2.html
Code:
<HTML>
<HEAD>

<SCRIPT LANGUAGE=&quot;JavaScript&quot;>

function popUp(URL) {
day = new Date();
id = day.getTime();
eval(&quot;page&quot; + id + &quot; = window.open(URL, '&quot; + id + &quot;', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=200,height=150,left = 540,top = 437');&quot;);
}
// End -->
</script>

</HEAD>
<BODY>
<!-- STEP TWO: Paste this onLoad event handler into the BODY tag -->

<BODY onLoad=&quot;javascript:popUp('maint.html')&quot;>

</BODY>
</HTML>


Hopefully you can see what I'm trying to do. Please post if you have any questions and I'll try to clarify.
 
Don't worry. I sorted it out.

Maint2.html goes like this. And Maint.html stays the same.
Code:
<html>

<head >


<SCRIPT LANGUAGE=&quot;JavaScript&quot;>
function popUp(URL) {
day = new Date();
id = day.getTime();
eval(&quot;page&quot; + id + &quot; = window.open(URL, '&quot; + id + &quot;', 'toolbar=0,scrollbars=0,location=1,statusbar=1,menubar=0,resizable=1,top=10,left=400,width=525,height=425');&quot;);
}
function closeMe() {
father = window.self;
father.opener = window.self;
father.close(); 
}
</script>

<title>Maint</title>

</head>


<BODY onLoad=&quot;javascript:popUp('popup.txt'); parent.closeMe()&quot;>

</body>
</html>
 
I know that the above doesn't include self centering, but I have another script for that, which I will be playing with later.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top