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

ways of writing this... 1

Status
Not open for further replies.

linckx

Technical User
Oct 2, 2002
18
hi there, what I want to ask here might be a little weird...
I don't want the script, but the 'rules' for this...

I want a popup window to open... (window.open)
I want the main window to become fullscreen (onLoad)
I want the x position be centered to the middle (availheight and then some equasion)
same for the y position...


now in flash actionscript I'd be able to write a similar thing for a movie clip, but since I'm not familiar with javascript, I did some searches (that's where I got the info between brackets)... but I need to know the way of taping them to a nice working string, but in a written down way, so that I can learn to 'play' with the codes...

btw; If I forget some things here please tell me too...

friendly greetings and thx in advance
robin
 
In your first window, you'll have a script to do the
body onload to resize itself to available width & height. then have the popup open using window.open; you can specify the width & height in the window.open paramters as well.
Then if you var a = window.open; you can reference the popup by a. So, then do a moveto(x,y) of the popup. WHere x is avail width /2 & y is avail height / 2.

HTH,

Jessica [ponytails2]
 
ok, I tried too specify the 'fullscreen-thingies' to the main page, but I still get another window... how can I name my main window?

and how do I write this availheight thing exactly? 'cause I think the case sensitivity got lost on the way...

robin
 
Here's an example...revised a little from what I said, you can do everything in the main page.

Code:
<html>
<head>
<script language=javascript>
  window.moveTo(0,0);
  window.resizeTo(screen.availWidth,screen.availHeight);

  function openPopup() {
    var lft = (screen.width / 3) - 10;
    var tp = (screen.height / 3) - 100;
    var wd = 285;
    var ht = 365;
    var options = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=auto,resizable=yes,';
    options = options + 'copyhistory=no,width=' + wd + ',height=' + ht + ',left=' + lft + ',top=' + tp;
    newWindow = window.open('yourpage.htm','PROCESS',options);
  }
</script>
</head>
<body>
<input type=button name=mybutton value=&quot;open popup&quot; onclick=&quot;openPopup();&quot;>
</body>
</html>


Jessica [ponytails2]
 
wow,

thanx jess for the script!
works great!
:)

robin
 
ooh yeah, I forgot..

you've got my star too now ;)

robin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top