-
iFrame Javascript resize with switch content menu
Okay, here's the problem. I have this site I'm currently building, http://www.towpc.com/ke5ehi/, and I have an iFrame for the main content (controlled by the menu on the left - item's with a ' * ' haven't been made yet). When you load the satellite page, it resizes fine, but when you load the chaser-on-the-road > on-the-road page (which has the switch content menu), the javascript only sizes the iFrame to the collapsed menu state, so if you expand any of the items, the page is cut-off. Any help would be appreciated (I'm still not that good on some of this
)
This is the onload handler for each page within the iFrame:
<body onload="if (parent.adjustIFrameSize)
parent.adjustIFrameSize(window);" topmargin=0 leftmargin=0>
This is the javascript for the main page:
<script type="text/javascript">
function adjustIFrameSize (iframeWindow) {
if (iframeWindow.document.height) {
var iframeElement = document.getElementById
(iframeWindow.name);
iframeElement.style.height = iframeWindow.document.height + 'px';
iframeElement.style.width = iframeWindow.document.width + 'px';
}
else if (document.all) {
var iframeElement = document.all[iframeWindow.name];
if (iframeWindow.document.compatMode &&
iframeWindow.document.compatMode != 'BackCompat')
{
iframeElement.style.height =
iframeWindow.document.documentElement.scrollHeight + 'px';
iframeElement.style.width =
iframeWindow.document.documentElement.scrollWidth + 'px';
}
else {
iframeElement.style.height =
iframeWindow.document.body.scrollHeight + 'px';
iframeElement.style.width =
iframeWindow.document.body.scrollWidth + 'px';
}
}
}
</script>
-
-
...is there a way to maybe get the javascript to read the expanded switch menu and set the iframe to that size?
-
-
is there a way to set a manual document length and just make the iframe a pre-determined size?
Last edited by KE5EHI; 08-15-2005 at 01:52 AM.
-
-
I use div tags and define the proportions in a css file. I imagine that you can define the dimensions of an iframe with and ID using css as well.
-
-
Moved this thread
I've re-done a little, but now it's all Dynamic Drive script, so I've continued this thread in the Dynamic Drive forum here
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks