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

Hyperlink text to opean specific size window?

Status
Not open for further replies.

help120

Technical User
Apr 15, 2001
198
US
Help I need to be able to have text on my index page opean up a specific size window and centerd on the screen.
 
help120,

Include the following scipt in the <HEAD></HEAD> section of your HTML page:

<script language=&quot;JavaScript&quot;>
//<!--

var launchMap = null;

var w = 0;
var h = 0;

function deadCentre(url,w,h) {
if (window.screen) {
var chasm = screen.availWidth;
var mount = screen.availHeight;
launchMap = window.open(url,'posB','width=' + w + ',height=' + h + ',left=' + ((chasm - w - 10) * .5) + ',top=' + ((mount - h - 30) * .5));
}
}
// -->
</script>

Then whereever you want the link, type the following:

<a href=&quot;javascript:deadCentre('myPage.htm',620,440)&quot;>Click Here to open window</a>

myPage.htm is the page you want to open in the window.
620 is the width of the window
440 is the height of the window.
Just change these to suit your case.

Hope this helps.
Mise Le Meas,

Mighty :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top