You need to sign in to do that
Don't have an account?
michaelforce
Dynamically change the height of your s-controls
I reckon this might be helpful to a lot of you. If you want to dynamically change the height of an s-control being displayed 'in-line' as part of any page layout, simply call the function below in your s-control after it has loaded (and as needed after anytime the contents of the s-control may change height). Replace ENTER_ID_HERE with the id of the s-control being run.
This same function can be used by s-controls being displayed in a web tab as well, just replace "ENTER_ID_HERE" with "itarget".
Code:
Hope this is found helpful. Happy new year all.function resizeframe(){ sframe=top.document.getElementById("ENTER_ID_HERE"); sframe.style.height=document.body.clientHeight + "px"; }
window.onresize=resizeframe;
... so text doesn't get cut off when a user changes the window dimensions.
e.g.
var elements = top.document.getElementsByTagName("iframe");
for (i=0;i<elements.length;i++)
{
if (elements[i].getAttribute("title").substr(0,4) == "your 4 letter prefix" ) {
elements[i].style.height=(document.body.clientHeight) + "px";
exit;
}
}