Created
October 2, 2013 13:11
-
-
Save jameymcelveen/6793503 to your computer and use it in GitHub Desktop.
Snippet of resizeParent function needed to resize your plugin in TheCity
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
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); |
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
Here is a full example: https://gist.github.com/jameymcelveen/6793546