JSFiddle - React, Tailwind, and code Playground
HTML
<div id="wrapper" style="height:100%;">
<div id="innerWrapper" style="height:100%;">
<div id="div1"></div>
<div id="div2"></div>
</div>
</div>
CSS
html
{
overflow: scroll;
}
html, body
{
height: 100%;
margin: 0;
padding: 0;
}
#div1 {
background-color: blue;
height: 500px;
}
#div2 {
background-color: yellow;
height: 500px;
}
JavaScript
var div = $("<div id='spacer'>").css({
height: 200,
backgroundColor: "green"
});
// The green div is removed after 3 seconds
// but a white void remains in IE
$("#innerWrapper").append(div);
$("#spacer")[0].scrollIntoView(false);
setTimeout(function () {
$("#spacer").remove();
}, 3000);