Dear All,
I'm coding a map js, it works well with IE6.0 and 7.0, however, when I run it with IE8, some errors occur.
hera are some code inside the js.
var _zoomSizes = [["256px","256px"],["512px","512px"], ["1024px","1024px"], ["2048px","2048px"], ["4096px","4096px"], ["8192px","8192px"], ["16384px","16384px"], ["32768px","32768px"], ["65536px","65536px"], ["131072px","131072px"], ["262144px","262144px"], ["524288px","524288px"], ["1048576px","1048576px"], ["2097152px","2097152px"], ["4194304px","4194304px"], ["8388608px","8388608px"], ["16777216px","16777216px"], ["33554432px","33554432px"], ["67108864px","67108864px"], ["134217728px","134217728px"]];
function setZoom(zoom) {
var innerDiv = document.getElementById("innerDiv");
innerDiv.style.width = _zoomSizes[zoom][0];
innerDiv.style.height = _zoomSizes[zoom][1];
alert(zoom+" "+innerDiv.style.width +" "+ innerDiv.style.height);
this.zoom = zoom;
};
You may note that there is alert statement inside the function setZoom(zoom),when the zoom is below 12 inclusive, the alert shows the function works well, while the zoom is greater than 12,say 13, the alert returns
13 1342177.27px 1342177.27px
while it should be
13 2097152px 2097152px
Same occurs when I zoom to 14,15,....
This situation seems mean that when we set a div's width or height with a number greater than a specific value, then the div's width or height will be reset to a limited value by IE8. Am I right? who know how to resolve this problem?
Thanks
HQY
I'm coding a map js, it works well with IE6.0 and 7.0, however, when I run it with IE8, some errors occur.
hera are some code inside the js.
var _zoomSizes = [["256px","256px"],["512px","512px"], ["1024px","1024px"], ["2048px","2048px"], ["4096px","4096px"], ["8192px","8192px"], ["16384px","16384px"], ["32768px","32768px"], ["65536px","65536px"], ["131072px","131072px"], ["262144px","262144px"], ["524288px","524288px"], ["1048576px","1048576px"], ["2097152px","2097152px"], ["4194304px","4194304px"], ["8388608px","8388608px"], ["16777216px","16777216px"], ["33554432px","33554432px"], ["67108864px","67108864px"], ["134217728px","134217728px"]];
function setZoom(zoom) {
var innerDiv = document.getElementById("innerDiv");
innerDiv.style.width = _zoomSizes[zoom][0];
innerDiv.style.height = _zoomSizes[zoom][1];
alert(zoom+" "+innerDiv.style.width +" "+ innerDiv.style.height);
this.zoom = zoom;
};
You may note that there is alert statement inside the function setZoom(zoom),when the zoom is below 12 inclusive, the alert shows the function works well, while the zoom is greater than 12,say 13, the alert returns
13 1342177.27px 1342177.27px
while it should be
13 2097152px 2097152px
Same occurs when I zoom to 14,15,....
This situation seems mean that when we set a div's width or height with a number greater than a specific value, then the div's width or height will be reset to a limited value by IE8. Am I right? who know how to resolve this problem?
Thanks
HQY