Skip to content

Instantly share code, notes, and snippets.

@hadees
Created April 5, 2016 06:09
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 hadees/7d740f8fe1b6485b9f11721efc38557c to your computer and use it in GitHub Desktop.
Save hadees/7d740f8fe1b6485b9f11721efc38557c to your computer and use it in GitHub Desktop.
$(document).ready(function() {
if(window.self !== window.top) {
var currentHeight = document.body.clientHeight;
var resizeIframeTracker = setInterval(function() {
var height = document.body.clientHeight;
if(currentHeight !== height) {
message = JSON.stringify({"frameHeight": height})
window.parent.postMessage(message, "*");
currentHeight = height;
}
}, 500)
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment