Get hands-on training for JIRA Software, Confluence, and more at Atlassian Summit Europe. Register now ›

This is a continuation to my previous post where I claimed that IE is broken. Well, it seems that it is not the only one.
Opera has problems of its own kind. When it comes to positioning pop-up windows, there is a difference between the x and y you set and you get as well.
Moving a pop-up window moves its top left corner relatively to the top left corner of its parent window. Unlike in other browsers, where a new pop-up window is treated as equal to its parent, Opera opens a pop-up window as a new tab. This window appears on top of its parent’s window content, but its visibility is restricted to the parent’s content area.
opera0.png
In other words, the pop-up window cannot be dragged outside, e.g. you cannot place the pop-up and the parent windows side by side.
opera1.png
That would not be so bad, only if window.screenLeft and window.screenTop returned the values that were relative to its parent window. Unfortunately, that’s not the case. Opera returns x and y of the top left corner measured from the top left corner of the screen. That’s right, x and y are taken as if this pop-up window was a stand-alone window, not a child of the window that opened it.
So how did we fix this ‘bug’? We didn’t. What we did was
if (!window.opera) window.moveTo(x,y);
That’s right, we ignore Opera completely when it comes to positioning this pop-up window. Let’s let Opera decide where it pops windows up. Don’t you love browser differences?!
Peace!

Fresh ideas, announcements, and inspiration for your team, delivered weekly.

Subscribe now

Fresh ideas, announcements, and inspiration for your team, delivered weekly.

Subscribe now