Skip to content

Instantly share code, notes, and snippets.

@jkeefe
Last active February 16, 2022 21:30
Show Gist options
  • Save jkeefe/fab613b7dedeac6b3883e539089b52cd to your computer and use it in GitHub Desktop.
Save jkeefe/fab613b7dedeac6b3883e539089b52cd to your computer and use it in GitHub Desktop.
Send a custom height to pym
// update height, sending an extra 20 pixels to be safe
const mainElementHeight = (document.getElementsByTagName('body')[0].offsetHeight + 20).toString();
pymChild.sendMessage('height', mainElementHeight);
//// may need to add this:
// instantiate pym object
window.pymChild = new Child();
// or, for cnn rig, inside your draw function:
pymChild.sendMessage('height', initialHeight);
// a second later send security height in hopes of resetting to actual height
setTimeout(() => { pymChild.sendHeight(); }, 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment