Created
April 5, 2016 06:09
-
-
Save hadees/7d740f8fe1b6485b9f11721efc38557c to your computer and use it in GitHub Desktop.
This file contains 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
$(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