Code: Select all
<script type="text/javascript">
function reportWindowSize() {
var myStack = document.liveCode.findStackWithName('myStandalone');
myStack.js2LC_resizeStack(window.innerWidth,window.innerHeight);
}
window.onresize = reportWindowSize;
</script>
Code: Select all
do "reportWindowSize" as JavaScript
Add this to your stack script to handle the returned parameters:
Code: Select all
on js2lc_resizeStack pWidth,pHeight
set the width of me to pWidth - 100
set the height of me to pHeight - 100
end js2lc_resizeStack
By the way, to make the stack appear centre of the frame I place this at the top of the <style> section of the HTML:
Code: Select all
body { font-family: arial; margin: 0; padding: none;
position: absolute;
left: 50%;
-webkit-transform: translate(-50%, 0%);
transform: translate(-50%, 0%)
}