相对于父窗口定位子窗口 [英] Positioning a child window relative to the parent

查看:205
本文介绍了相对于父窗口定位子窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个从其父级打开的远程控制窗口。在

加载时,遥控器相对于屏幕定位使用

window.moveTo(x,y)。


什么我想要发生的是遥控器打开停靠在相对于父母(开启者)的特定位置




幸运的是,我需要这个只在IE中工作,所以至少我没有必要担心跨浏览器问题。


有谁知道如何打开一个窗口父母的锚点是什么?

wiondow?

解决方案

var winRef =

window.open(" foo.html"," winName"," height = 100,width = 200,left = 0,top = 0");


感谢您的回复。


您所展示的内容允许相对于父窗口进行定位,但

我正在寻找的是一种相对于*元素*的定位方法,在那个窗口中。例如,我想在父级中的一个

表格单元格的顶部打开窗口。显然,根据用户在父级中打开的工具栏等,该值将是可变的,具体取决于
。不知怎的,我必须

在父窗口中传递锚的位置。


" VK" < SC ********** @ yahoo.com>在消息中写道

news:11 ********************** @ o13g2000cwo.googlegr oups.com ...

var winRef =
window.open(" foo.html"," winName"," height = 100,width = 200,left = 0,top = 0");


Geoffrey H. Goldberg写道:

感谢您的回复。

您所展示的内容可以定位相对于父窗口,




否。请求的弹出窗口相对于用户定位

屏幕,而不是父窗口。


但我正在寻找的是相对于窗口中*元素*的定位方法。例如,我想打开父窗口中表格单元格顶部的窗口。



为什么你需要一个请求的弹出窗口来显示那个

弹出窗口中的内容?我相信有一个更合适和用户友好的方式

做你的网页要求而无需借助二级

窗口。


显然,该值将根据用户在父级中打开的工具栏等变化。




没有直接可靠的方法可以找出用户的浏览器

窗口工具栏及其高度或总高度。即使在基于Mozilla的

浏览器中,用户也可以自定义隐藏的pref,以避免泄露浏览器窗口的

outerHeight。

$ b $bGérard

-

删除等等给我发电子邮件


I have made a remote control window which opens from its parent. On
loading, the remote is positioned relative to the screen using
window.moveTo(x,y).

What I would like to happen is the remote control to open docked in a
specific location relative to the parent (opener).

Fortunately, I need this to work ONLY in IE, so at least I don''t have to
worry about cross-browser issues.

Does anyone know how to open a window realtive to an anchor in the parent
wiondow?


解决方案

var winRef =
window.open("foo.html","winName","height=100,width =200,left=0,top=0");


Thank you for the response.

What you have shown allows positioning relative to the parent window, but
what I am looking for is a means of positioning relative to an *element* in
that window. For instance, I would like to open the window on top of a
table cell in the parent. Obviously that value will be variable depending
upon what toolbars, etc. the user has opened in the parent. Somehow I must
pass the anchor''s postion in the parent window.

"VK" <sc**********@yahoo.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...

var winRef =
window.open("foo.html","winName","height=100,width =200,left=0,top=0");



Geoffrey H. Goldberg wrote :

Thank you for the response.

What you have shown allows positioning relative to the parent window,
?
No. The requested popup window is positioned relative to the user
screen, not the parent window.

but what I am looking for is a means of positioning relative to an *element* in
that window. For instance, I would like to open the window on top of a
table cell in the parent.

Why do you need a requested popup window to display whatever is in that
popup window? I''m sure there is a more suitable and user-friendly way to
do what your webpage requirements are without resorting to a secondary
window.

Obviously that value will be variable depending upon what toolbars, etc. the user has opened in the parent.



There is no direct and reliable way to figure out the user''s browser
window toolbars and their height or total height. Even in Mozilla-based
browsers, the user can customize an hidden pref to avoid revealing the
outerHeight of the browser window.

Gérard
--
remove blah to email me


这篇关于相对于父窗口定位子窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆