Skip to content

Instantly share code, notes, and snippets.

@jameymcelveen
Created October 2, 2013 13:11
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 jameymcelveen/6793503 to your computer and use it in GitHub Desktop.
Save jameymcelveen/6793503 to your computer and use it in GitHub Desktop.
Snippet of resizeParent function needed to resize your plugin in TheCity
var resizeParent = function (url) {
var target = target || parent;
var body = document.body;
var html = document.documentElement;
var height = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight);
target.postMessage(height, url);
}
// usage
var parentUrl = "https://YOURSUBDOMAIN.onthecity.org";
resizeParent(parentUrl);
@jameymcelveen
Copy link
Author

@jmaddington
Copy link

Are you on the other Github repo? I took your original and tweaked it, submitted a pull request. Basically, it just sets a setInterval in case the document height changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment