Skip to content

Instantly share code, notes, and snippets.

@fonsecajavier
Forked from jtrezza/iframe_header_code.html
Last active August 26, 2016 23:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fonsecajavier/eeeeddf1c8b54ba61baad447b97aa814 to your computer and use it in GitHub Desktop.
Save fonsecajavier/eeeeddf1c8b54ba61baad447b97aa814 to your computer and use it in GitHub Desktop.
Injected snippet for Welltok surveys in Qualtrics
<head>
<script type="text/javascript">
window.iFrameResizer = {
readyCallback: function(){
parentIFrame.sendMessage(documentHeight())
}
}
function documentHeight() {
return Math.max(
document.documentElement.clientHeight,
document.body.scrollHeight,
document.documentElement.scrollHeight,
document.body.offsetHeight,
document.documentElement.offsetHeight
);
}
</script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/3.5.3/iframeResizer.contentWindow.js"></script>
</head>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment