Created
June 29, 2017 22:00
-
-
Save pilgreen/4aca48966835ecb08dc364e3985f825f to your computer and use it in GitHub Desktop.
Very basic seamless iframes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.addEventListener("message", e => { | |
let d = e.data; | |
if(d.sentinel == 'gofer' && d.type == 'resize') { | |
let f = document.querySelector(`iframe[src="${d.location}"]`); | |
if(f && f.style) { | |
f.style.height = `${d.height}px`; | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Code on the iframe should be something like the following: