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!

open new window positioning Problem ...please help...

Status
Not open for further replies.

cinic

IS-IT--Management
Nov 29, 2005
3
RO
Hi!

I have a page that contains 2 frames (left and main).
In the main frame i have a textbox. When I click on it
I open a new window.
The problem is that I want to be able to open this
window relatively to main frame position. In other words ...
if I choose to hide some toolbars that are placed in the upper
part of the browser to be able to open the window exactly in the same place relatively to the upper left corner of the main frame.
Please help me!.. I'm desperate ... Thanks ..
 
Must your solution be cross-browser compliant? I think there may be something you can do with CSS, but if you've just got IE to worry about, JavaScript has a window.moveTo(...) function that you should look into.

Dave


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
O Time, Strength, Cash, and Patience! [infinity]
 
When you open a window, you can specify the top and left coordinates. IF you can detect the top-left coordinates of the body or html elements (depdending on DOCTYPE), you should be home and dry.

Hope this helps,
Dan


[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
No .. The application is only for Mozilla. The problem is that
the window.moveTo(0,0) moves the new window at browser's upper left corner NOT at main FRAME upper corner. I want to position
relatively to frame.
 
If moveTo works in Mozilla, you're half-way home. Obviously, you have to figure out what values to send as parameters (other than 0,0).

Similar to what Dan said, you should be able to determine the coordinates of the frame from its parent. I guess Mozilla is considering the whole window and not just the page.

Before opening or moving the window, call a function that is IN the parent which finds and returns the location of the main frame. Use that info in the window.open or window.moveTo calls.

'hope that helps.

--Dave


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
O Time, Strength, Cash, and Patience! [infinity]
 
Yes I know .. but I did'nt found a way to obtain the frame
X and Y values. How can this be done ...?
I've tried with something like
document.getElementById(frame_id).style.posLeft
but it returns 0.
 
Try:

document.getElementById(frame_id).offsetLeft;

This works for me in IE.

Dave


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
O Time, Strength, Cash, and Patience! [infinity]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top