平铺 2 弹出窗口
我已经为此奋斗了一周,似乎到处碰壁……所以我在这里寻求一些帮助……希望这是可能的。
我需要平铺 2 个弹出窗口...不用担心...不是烦人的窗口,它们会根据用户的请求
确定...就这一点。
我试图在我的网站上建立一个链接,打开两个弹出窗口,然后重定向到特定页面。
顺便说一句:两个弹出窗口都位于同一域和链接上。
我想这很简单,但这里更详细地概述了陷阱和原因......我可能在这方面还很遥远,所以请告诉我是否有更好的方法。
好的..这就是我想要做的事情以及原因:
首先我的网站上有链接。
单击时,它会打开一个弹出窗口: 顶部:0 左:0 width: 屏幕宽度 height: 100 (这导致新窗口的内部高度为 100px) 现在菜单栏=0,工具栏=0,位置=0,可调整大小=0,滚动条=0,状态=0..因为
我想将两个弹出窗口平铺在&之上。我需要将第二个弹出窗口放置在第一个弹出窗口的底部...但是由于地址栏和浏览器差异等导致额外的高度,我需要outer.height。
所以我所做的是将一个脚本放入 popup.1 中,该脚本获取outer.height 并将其与成功消息一起发送回 opener(启动弹出窗口的原始页面)
然后我需要在第二个中使用该outer.height弹出窗口启动为: top:[popup.1的外部高度] 左:0 宽度:屏幕宽度 height: screen.height - [popup.1的外部高度] 现在menubar = 1,toolbar = 1,location = 1,可调整大小= 1,scrollbars = 1,status = 1
...理论上这应该给我两个完全覆盖屏幕的弹出窗口,与popup.2完美地平铺在一起正好低于 popup.1,没有空格或交叉。
然后,我需要 popup.2 (与启动它的主页相同)将成功消息发送回打开器/原始浏览器窗口,并使原始页面重定向到不同的页面(启动页面)。因为它与开启器相同,我想它需要检查它是原始消息还是弹出窗口,以便它知道发送此消息。显然原件不需要发送此消息。
最后,我需要它,以便当 popup.2 关闭时,它会向 opener 发送一条消息,将 opener 返回到原始启动页面。同样,原件不需要这样做,因此需要进行检查。
这行得通吗? 它会跨浏览器兼容吗? 有更好的方法吗?
我希望这一切都有道理,有人可以提供帮助...我不会发布我当前的代码,因为它一团糟并且不起作用...希望我的概念没问题...请让我知道,任何代码帮助将不胜感激。
如果您认为有帮助,我很乐意使用任何库。我确实用 jquery 玩了一下,但仍然不起作用。
如果这是不可能的,那么请有人告诉我,以便我可以重新考虑这一点。
非常感谢任何建议
干杯 C
I have struggled with this for a week now and seem to hit walls everywhere I go...so here i am looking for some help with this....hopfuly it is possible.
I need to TILE 2 popup windows....dont worry...not annoying ones and they will be at the request of the user
ok...to the point.
What im trying to is have a link on my site that opens two popups then redirect to a specific page.
BTW: both popups are on the same domain and the link.
That bit is easy enough i guess but here it is in more detail outlining the pitfalls and reasons...I may be way off on this so please tell me if there is a better method.
OK..so this is what im trying to do and why:
First i have the link on my site.
When clicked it opens a popup that is:
top:0
left:0
width: screen.width
height: 100 (this resulting in the inner height of the new window being 100px)
menubar=0,toolbar=0,location=0,resizable=0,scrollbars=0,status=0
now..becuase i want to tile the two popups to be exactly above & below each other I need to place the second popup at the exact bottom of the first popup...but because of the extra height due to the address bar and browser differences etc I need the outer.height.
so what i did was place a script into popup.1 that gets the outer.height and sends it back along with a success message to the opener (original page that launched the popup)
Then I need to use that outer.height for the second popup to launch as:
top:[the outer height of popup.1]
left:0
width: screen.width
height: screen.height - [the outer height of popup.1]
menubar=1,toolbar=1,location=1,resizable=1,scrollbars=1,status=1
now...in theory this should have given me two popups that completly cover the screen that tile perfectly together with popup.2 being exactly below popup.1 without and space or crossover.
I then need popup.2 (which is the same as the main page that launched it) to send a success message back to the opener/original browser window and for the original page to redirect to a different page (splash page). Because it is the same as the opener i guess it will need to check if it is the original or a popup so it know to send this message. abviously the original doesnt need to send this message.
Lastly, i need to have it so when popup.2 is closed it sends a message back to the opener which returns the opener to the original lauch page. again, the original wouldnt need to do this so a check would need to happen.
Is this going to work?
will it be cross browser compatable?
is there a better way to do this?
I hope this all makes sence and someone can help...I wont post my current code as it's a mess and doesnt work...hopfuly my concept is ok...please let me know and any code help would be greatly appreciated.
Im happy to use any libraries if you think it will help. I did play a little with jquery for this but still didnt work.
if this is not possible then someone please tell me so i can rethink this.
Any advice is much appreciated
Cheers
C
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你不可能完全做你想做的事情,并让它在所有浏览器/操作系统/环境中都相同,
我建议在当前页面上显示两个 div(如果内容出现,你可以将 iframe 放在 div 中)来自不同的服务器),将它们设置为绝对位置并增加 zindex,以便它们始终位于顶部。这样您就可以完全控制屏幕上“弹出窗口”的位置。
如果用户单击链接时 url 需要更改,您可以随时在链接上放置一个查询字符串,指示下一页需要显示这些“弹出窗口”
there's no way you can do exactly what you want to do and have it be identical across all browsers/operating systems/environments
what i would suggest instead is show two divs on the current page (you can put iframes in the divs if the content comes from a different server), make them both position: absolute and increase the zindex so they're always on top. that way you do have complete control over the position of the 'popups' on the screen.
if the url needs to change when the user clicks the link, you could always put a querystring on the link indicating to the next page that these 'popup's need to be shown