Skip to content

Instantly share code, notes, and snippets.

@benhodgson87
Last active August 29, 2015 14:14
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 benhodgson87/a66e461abae4f10032f7 to your computer and use it in GitHub Desktop.
Save benhodgson87/a66e461abae4f10032f7 to your computer and use it in GitHub Desktop.
// 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