Skip to content

Instantly share code, notes, and snippets.

@prefinery
Last active August 29, 2015 14:15
Show Gist options
  • Save prefinery/7fc76592825e481fdc3a to your computer and use it in GitHub Desktop.
Save prefinery/7fc76592825e481fdc3a to your computer and use it in GitHub Desktop.
Dynamically resize Prefinery embedded Application Form
<script type="text/javascript">
var PrefineryEventMethod = window.addEventListener ? "addEventListener" : "attachEvent";
var PrefineryReceiveMessage = window[PrefineryEventMethod];
var PrefineryMessageEvent = PrefineryEventMethod == "attachEvent" ? "onmessage" : "message";
PrefineryReceiveMessage(PrefineryMessageEvent, function(e) {
var message = e.data.split('|');
if (message[0] == "PrefineryIFrameHeight") {
document.getElementById('prefinery_iframe_inline').style.height = message[1] + "px";
}
}, false);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment