Forum Moderators: open
But generally, Javascript uses h/2 and w/2 (height and width divided by half) to find 'center point.'
The trick would then be to have it adjust for the height/width of the frame (if its 300 wide, to adjust for +-150 to perfectly center it).
But, seriously, consider using a centered DIV and your frame should show up nicely within that.
At least, thats how I would approach it . . . .
Good luck,
Patrick Elward
Also, check Google for javasript +frames +center and see what you get
>I have to place the webpage exactly in the middle from all directions(top,bottom,left,right) and i think that if you want to do that for 120 different pages i have it is going to take loads of time.
But generally, Javascript uses h/2 and w/2 (height and width divided by half) to find 'center point.'
The trick would then be to have it adjust for the height/width of the frame (if its 300 wide, to adjust for +-150 to perfectly center it).
>The dimensions of the frame are pre-set to 800x600
But, seriously, consider using a centered DIV and your frame should show up nicely within that.
>That is what i am using at the moment...although it does not space equally from top and bottom...only from left and right.
Also, check Google for javasript +frames +center and see what you get
>I have done that already and it comes up with how to center a pop-up windo. I am wondering if we can use the same principal for the frame.
Thank you for the time you took to look into the question.
Well, if you use "padding" you can force it to push down 300 pixels or whatever from the top and you can't control how far down the window is going to open (unless you do the popup window as you mentioned).
thats another way to make it 'appear' in the middle.
sorry I can't be of more use.
Patrick Elward
[edited by: korkus2000 at 3:28 pm (utc) on May 19, 2004]
[edit reason] edited typo [/edit]
That said, it occurs to me that it might be possible (though I'm skeptical) to set a div to 100% height, then read its vertical dimension by querying its CSS properties. I'll try to give that approach some investigation this evening, when I get home from work.
[edited by: korkus2000 at 3:52 pm (utc) on May 19, 2004]
[edit reason] Removed off topic chatter [/edit]
[wpdfd.com...] (navigation at the bottom of the page)