Internet Explorer 10, max div size of 1.533.917 px

2019-02-20 23:35发布

问题:

I need to make a really big div, in order of millions of pixels.

Searching I found this thread that proves that IE can manage up to 10.000.000 of px.

Determine Maximum Possible DIV Height

But in my test IE 10 can't size a div more than 1.533.917 px.

This is my test: jsfiddle test

The value between brackets is the size that I try to set and the previous value is the computed size of the div calculated with jquery.

The question is: Why IE can't size a div more than 1.533.917 px in my test?

This is the js that makes the div bigger:

$(document).ready(function () {
    var interval = setInterval(function () {

        height  += 10000;
        width   += 10000;

        $(".sujeto").css({width: width, height: height});
        $(".contador").text( "Width: " + ( $(".sujeto").width() ) + "px (" + width + ") - Height: " + ( $(".sujeto").height() ) + "px (" + height + ")");

    }, 100);

});

回答1:

Any solution for this scenario.Below link demonstrates the problem exactly. The example not created by me Nathan Williams.

<div style="width: 500px; height: 500px; overflow: auto;">
    <div style="width: 500px; height: 10000000px; overflow: hidden; position: relative;">
        <span style="left: 0px; top: 0px; position: absolute;">top</span>
        <span style="left: 0px; top: 1193030px; position: absolute;">IE8 limit (approximate)</span>
        <span style="left: 0px; top: 1533900px; position: absolute;">IE10 limit (approximate)</span>
        <span style="left: 0px; top: 9999950px; position: absolute;">bottom</span>
    </div>
</div>

http://jsfiddle.net/Bckbr/