Created
July 1, 2022 14:50
-
-
Save jkimbo/f4534c0b749bd1d766cb1ef34371ee48 to your computer and use it in GitHub Desktop.
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
<iframe style="width: 100%;" id="fronted-payments-container" src="https://app.fronted.rent/embed/v1/widget?partnerId=..." scrolling="no" /> | |
<script> | |
(function() { | |
var frame = document.getElementById("fronted-payments-container"); | |
frame.addEventListener("load", function() { | |
frame.contentWindow.postMessage("measure-height", "https://app.fronted.rent"); | |
}); | |
window.addEventListener("message", function(event) { | |
if (event.origin !== "https://app.fronted.rent") return; | |
var data = JSON.parse(event.data); | |
if (data.message === "measure-height") { | |
frame.style.height = data.height + "px"; | |
} | |
}); | |
})(); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment