Ticket #3657 (new bug)

Opened 12 months ago

Last modified 12 months ago

Handler/Box.js - Causing map to shift when calculating boxOffsets in IE8

Reported by: ca0v Owned by:
Priority: minor Milestone:
Component: general Version: SVN
Keywords: Cc:
State:

Description

By adding these lines to the getBoxOffsets method the map will no longer shift in IE8. I could not determine why the map was shifting without this change...maybe scrollbars were being temporarily created...but certainly with this seemingly harmless change the issue was resolved. Set testDiv.style.top = testDivstyle.left = -9999 before adding the div to the document.

getBoxOffsets: function() {

if (!this.boxOffsets) {

// Determine the box model. If the testDiv's clientWidth is 3, then // the borders are outside and we are dealing with the w3c box // model. Otherwise, the browser uses the traditional box model and // the borders are inside the box bounds, leaving us with a // clientWidth of 1. var testDiv = document.createElement("div"); //testDiv.style.visibility = "hidden";

here -> testDiv.style.top = -9999; here -> testDiv.style.left = -9999;

testDiv.style.position = "absolute"; testDiv.style.border = "1px solid black";

Change History

Changed 12 months ago by ca0v

  • summary changed from Handler/Box.js - Causing map to shift when calculating boxOfffsets in IE8 to Handler/Box.js - Causing map to shift when calculating boxOffsets in IE8

Changed 12 months ago by erilem

I'm interested to know in what OL version the problem occurs, and there are regressions from past releases.

Changed 12 months ago by ca0v

This problem exists in 2.11 and SVN..can't comment on earlier versions.

Note: See TracTickets for help on using tickets.