Hey. I’m making a wordpress theme that will have a SMF forum incorporated into one of the pages.
I’ve decided to use an iframe that calls in the forum (which is in the same domain), after trying several of the auto height scripts, including ones I used before with success, I got nothing.
I’m not sure if it’s a wordpress thing, but the scripts I’m so familiar with just don’t want to work.
Since forums change their height with all the different pages, this is an essential script for me. The only script (a new one) that somewhat works is the following:
<script language="javascript" type="text/javascript">
function resizeIframe(obj)
{
obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px';
obj.style.width = obj.contentWindow.document.body.scrollWidth + 'px';
}
</script>
which eventually gets called with:
onload='javascript:resizeIframe(this);'
inside the iframe tag.
Now, this seemed to work just fine, but now the height of the page gets added the more I browse. if for example i go to a topic with a lot of replies (meaning, a long page height), and I browse back to the index page, that extra height isn’t gone.
You can see what I mean here:
cudamine.com/wordpress/?page_id=39
I was wondering if there is something that can be done to this script to stop this and properly resize the iframe.
The other script I’ve used was:
lost-in-code.com/programming/jquery-auto-iframe-height/
which worked great as you can see here:
cudamine.com/santa-maria/forum.php