dynamic iframe

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
5/3/2010 4:20:03 PM
Gravatar
Total Posts 3

dynamic iframe

I would like to make a dynamic iframe where iframe height depends on the content height. I tried the following approach, but it did not work, iframe height is not adjusted dynamically by the content height. This approach worked standalone, but not in mojoportal. Do you know why? Is it possible to have a dynamic iframe in mojoportal?

(1) In layout.master, I added javascript:

<script language="JavaScript">
function iFrameHeight() {
if(document.getElementById && !(document.all)) {

h = document.getElementById('iframename').contentDocument.body.scrollHeight;
document.getElementById('iframename').height = h;
}
else if(document.all) {
h = document.frames('iframename').document.body.scrollHeight;
document.all.iframename.style.height = h;
}
}
</script>

(2) In html content source code, I wrote:

<iframe scrolling="no" frameborder="0" onLoad="iFrameHeight();" src="http://myiframepage.aspx" id="iframename" marginwidth="0" marginheight="0" style="width: 100%;"></iframe></p>

 

Thanks!

Xiaoming

5/3/2010 7:31:28 PM
Gravatar
Total Posts 3

Re: dynamic iframe

I was able to get the dynamic iframe working with the same scripts above. What I did wrong was not to have the iframe reference code on the same server of mojoportal server.

Xiaoming

6/29/2010 5:27:03 PM
Gravatar
Total Posts 156

Re: dynamic iframe

Could you elaborate what reference code you are referring to there?
 

You must sign in to post in the forums. This thread is closed to new posts.