diff --git a/wiki/pages/attributions.html b/wiki/pages/attributions.html index 44a04182b13f3301e561b859e14fcb0d7f2a1ef9..71bc09fa488c19733735cbec02145a278cd3db15 100644 --- a/wiki/pages/attributions.html +++ b/wiki/pages/attributions.html @@ -56,8 +56,8 @@ } #igem-attribution-form { width: 100%; - height: 80vh; /* Adjust the height as needed */ border: none; + min-height: 500px; /* Set a minimum height */ } </style> </head> @@ -77,9 +77,6 @@ <div class="row mt-4"> <div class="col-lg-12"> - <script type="text/javascript"> - // iframe height listener script - </script> <iframe id="igem-attribution-form" src="https://teams.igem.org/wiki/Tsinghua/attributions" @@ -88,6 +85,25 @@ </div> </div> </div> + + <script type="text/javascript"> + function adjustIframeHeight() { + var iframe = document.getElementById('igem-attribution-form'); + iframe.onload = function() { + iframe.style.height = iframe.contentWindow.document.body.scrollHeight + 'px'; + }; + + // Listen for changes in iframe content + window.addEventListener('message', function(event) { + if (event.data.type === 'resize') { + iframe.style.height = event.data.height + 'px'; + } + }, false); + } + + // Execute when the page is fully loaded + window.onload = adjustIframeHeight; + </script> </body> </html> {% endblock %} \ No newline at end of file