Content providers can set iFrame sizes using the IMS standard lti.frameResize through a POST message in the incoming data. This allows LTI content providers to define the iFrame size that optimally displays the learning content within Brightspace. As a result, users may notice different sizes of iFrames displaying external content. Administrators may notice a POST message included in any incoming LTI connections.
Code Samples
Administrators must send a message to the iFrame's parent (using PostMessage) in order to set iFrame height. The content of this message will contain a field called handler
which is set to lti.frameResize
, and a field called height
which is the desired height of the iFrame.
An example piece of code in the iFrame could appear as follows:
<script type="text/javascript" >
document.addEventListener('DOMContentLoaded', function() {
setTimeout(function() { parent.postMessage(JSON.stringify({ subject:
"lti.frameResize", height: 500 }), "*"); }, 0); } ); </script>