Last active
August 29, 2015 14:14
-
-
Save benhodgson87/a66e461abae4f10032f7 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
// Transmitter | |
var storedHeight = 0, payload; | |
setInterval(function() { | |
var currentHeight = $('.ng-scope').height(); | |
if (currentHeight == storedHeight) { | |
return false; | |
} else { | |
storedHeight = currentHeight; | |
payload = JSON.stringify({ height: currentHeight }); | |
parent.postMessage(payload, "*"); | |
} | |
}, 100); | |
// Receiver | |
var resp; | |
eventer(messageEvent,function(e) { | |
resp = JSON.parse(e.data); | |
$('.cs-data').height(resp.height); | |
},false); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment