English 中文(简体)
Tile 2 popup windows
原标题:

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

最佳回答

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

问题回答

暂无回答




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签