The iframe resizes on its load event, not on changing the tab. You haven't mentioned what triggers a tab change though. Is it a click event or something else? If it's a click event, putting this script in the head of the page with the tabs on it (the page in the iframe) has a good chance of working:
Code:
<script type="text/javascript">
(function(){
var pframes = parent.window.frames,
piframes = parent.document.getElementsByTagName('iframe'),
i = pframes.length, frameid;
while(--i > -1){
if(pframes[i] === this){
frameid = piframes[i].id;
break;
}
}
function resizeIframe(){
setTimeout(function(){parent.resizeIframe(frameid);}, 100);
}
if (document.addEventListener){
document.addEventListener('click', resizeIframe, false);
}
else if (document.attachEvent){
document.attachEvent('onclick', resizeIframe);
}
})();
</script>
But without seeing the pages, there's so much I cannot be certain of. And:
The browser cache may need to be cleared and/or the page refreshed to see changes.
If the event that changes the tabs isn't a click event, or if there's any problem . . . In any case:
If you want more help, please include a link to the page (the top page in this case, the one with the iframe ssi script on it) on your site that contains the problematic code so we can check it out.
Bookmarks