New Internet Explorer windows do not respect reset zoom level when using script

Article ID: 2741211 - View products that this article applies to.
Expand all | Collapse all

Symptoms

Consider the following scenario. You use Windows Internet Explorer 8 or Windows Internet Explorer 9 to browse to a page that has a zoom level other than 100%. This page contains a button that opens a new window with specific dimensions using script. You have the Reset zoom level for new windows and tabs option set under the Advanced tab of Internet Explorer Internet Options. When you click the button, the new window opens with the same zoom level as the parent window. This can cause some unexpected behavior on the child window where portions of the child window are not visible.

On Internet Explorer versions prior to Internet Explorer 8, the new window opens with a zoom level equal to 100%

Cause

In Internet Explorer 8 and above, windows created using the window.open API (as well as showMod[al:eless]Dialog and createPopup) have been designed to not honor the Reset zoom level for new windows and tabs setting and always inherit the zoom factor from their parent page. 

Resolution

The new window dimensions and the dimensions of the objects it contains can be scaled according to the zoom level that it inherits. The pertinent formulas are:

1. The actual zoom level can be calculated as:


var zoomLevel = window.screen.deviceXDPI / window.screen.logicalXDPI;


2. To counterscale an element, the formula is:


var objectWidth = desiredUnscaledWidth / zoomLevel;var objectWidth = desiredUnscaledWidth / zoomLevel;

Note This is a "FAST PUBLISH" article created directly from within the Microsoft support organization. The information contained herein is provided as-is in response to emerging issues. As a result of the speed in making it available, the materials may include typographical errors and may be revised at any time without notice. See Terms of Use for other considerations.

Properties

Article ID: 2741211 - Last Review: August 9, 2012 - Revision: 2.0
Applies to
  • Windows Internet Explorer 8
  • Windows Internet Explorer 9
Keywords: 
KB2741211

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com