Skip to content

Instantly share code, notes, and snippets.

@valueof
Last active August 29, 2015 14:27
Show Gist options
  • Save valueof/86864c4d8d7af01a162c to your computer and use it in GitHub Desktop.
Save valueof/86864c4d8d7af01a162c to your computer and use it in GitHub Desktop.
<iframe id="myid" src="embed.html" onload="var i=document.querySelector('#myid'),a=i.id,s='style';window.addEventListener('message',function(e){var m=e.data.split(':');if(m[0] == a)i[s].height=m[1],i[s].width=m[2]});i.contentWindow.postMessage('yo:'+a,'*')">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment