have a look for postMessage (to post the height to parent window onsceneload) and onmessage to receive the height in wp …
hypedoc onsceneload (first scriptcall!)
var height = hypeDocument.getElementProperty(element, 'height'); //scene(layout)height
window.parent.postMessage(["target_iFrameId", height], "*");//id of your iFrame within wp
wp:
window.addEventListener('message', function(e) {
var eventName = e.data[0];
if(eventName.indexOf('target_iFrameId') != -1){
var data = e.data[1];
var iframe = document.getElementById(eventName);
iframe.height = data + 'px';
}
you can also change the iFrames height directly from within hype when not relying to get this work crossorigin …
also, if your sceneheight itself is dynamic use onload, onresize events to get current height