Okay, I know I'm a noob.... So here's a noob question: I've implemented a piece of code that checks how much data a given iframe has at any time, and adjust the height correspondingly. I got my code working in a plain html page but when I implement it in umbraco, it seems like the code isn't activated.
I've tried creating a macro, and insert on a page, directly into a template. It just doesn't activate. I'm missing something ( "you think? ;0) ) could someone help me out.
The script is:
<script language="JavaScript"> <!-- function calculateHeight() { //find the height of the internal page var the_height=document.getElementById('it_drift').contentWindow.document.body.scrollHeight;//change the height of the iframe document.getElementById('it_drift').height=the_height; } //--> </script>
Why doesn't this work in Umbraco?
Okay, I know I'm a noob.... So here's a noob question: I've implemented a piece of code that checks how much data a given iframe has at any time, and adjust the height correspondingly. I got my code working in a plain html page but when I implement it in umbraco, it seems like the code isn't activated.
I've tried creating a macro, and insert on a page, directly into a template. It just doesn't activate. I'm missing something ( "you think? ;0) ) could someone help me out.
The script is:
and the iframe tag like this:
I hope someone can help me out, it's driving me off the wall !!
code looks ok but you could try using:
instead of
Just a thought.... :-)
Regards,
Kevin
Have you dropped an alert("calculateHeight is running"); to see if the function is even being called?
You could also try using jquery's $(document).ready() function. It's fired right after the DOM is loaded but before all of the
page content.
-Chris
is working on a reply...