Last active
February 16, 2022 21:30
-
-
Save jkeefe/fab613b7dedeac6b3883e539089b52cd to your computer and use it in GitHub Desktop.
Send a custom height to pym
This file contains 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
// 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