3

In Firefox and Chrome, opening a new window via the JavaScript window.open() and zooming in/out in that window will cause the parent window it was opened from to zoom by the same amount.
Is there any way to stop this from happening, or a way to set the child window as its own parent so as to allow independent zooming?

shA.t
  • 16,580
  • 5
  • 54
  • 111
user2070038
  • 31
  • 1
  • 2
  • In Firefox, the zoom seems to be linked to the domain you're on. So if I zoom this site, all the other stackoverflow tabs and windows zoom with it (but a tab on meta.stackoverflow.com does not). You could try opening the window on another sub-domain, but then you'll hit cross-site scripting limitations. You could implement this in JS, perhaps by adjusting the base font-size for the document in the popup window (assuming everything else is sized using `em` or other font-size relative units)? – Olly Hodgson Nov 20 '13 at 17:01
  • I've tried to change the size...and it works for a second, but firefox then Resizes back to 100%. humpWindow = window.open("HumpActivitySum.jsf", "_new", "location=1,status=1,scrollbars=1,width=2000,height=1000,resizable=false", false); humpWindow.document.getElementById("all").style.fontSize="80%"; – user2070038 Nov 21 '13 at 16:03
  • I suspect you'd need to wait for the document to load (e.g. use the `load` event or the jQuery `ready` event) before setting the font size, otherwise the CSS will load and set it back again! – Olly Hodgson Nov 21 '13 at 17:11
  • I've tried to implement jQuery to achieve my results, but so far, the header just goes white whenever I hit a key. I've tried this so when I hit enter, the page font size decreases, but no dice. ' ....... ' – user2070038 Nov 22 '13 at 14:21

2 Answers2

0

There's an article here on FF and Opera (?) That might be able to help -

Firefox and Opera Zoom In Zoom Out using javascript

The article covers wanting to change the zoom through javascript.

You might be able to use this or something similar to zoom to what size you want.

Community
  • 1
  • 1
Plasmarob
  • 1,321
  • 12
  • 20
0

Assign zoom css style at your new page.

.zoom {
  zoom: 150%;
}

This will give you independent zoom without affecting parent window.

https://css-tricks.com/almanac/properties/z/zoom/

Brain90
  • 1,551
  • 18
  • 21