JSFiddle - React, Tailwind, and code Playground
CSS
body { height: 2000px; }
iframe {
position:absolute;
top:0;
left:0;
width: 200px;
height: 200px;
border:none;
}
#out{
position: absolute;
top: 2px;
left: 2px;
}
JavaScript
var iframe = $( "iframe" )[0],
iframeWindow = iframe.contentWindow,
iframeDoc = iframe.contentDocument || iframeWindow.document;
iframeDoc.write("<!doctype html><html><body>");
$( iframeDoc.body ).css({
height: "2000px",
background: "blue"
});
console.log( "window height: " + $( window ).height() );
console.log( "iframe window height: " + $( iframeWindow ).height() );