By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,376 Members | 1,566 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,376 IT Pros & Developers. It's quick & easy.

iframe resizing.

P: 1
Have an issue with an iframe in FF blocking links in a z-index layer behind the layer containing the iframe. It works in IE. I can't change the layer index of the iframe because it's content needs to be on top all the time. Whenever the user mouseovers that iframe content it should expand to full size.

I haven't figured out how to change the height of the ifrmae from Doc2. It should be something like...
parent.doc1div.doc1frame.style.height="300";

I think. not sure.

Document 1.
[HTML]<html>
<head>
<title>doc1</title>
</head>
<body>
<div id="doc1div" height='500'></div>
<script type="text/javascript">
document.getElementById('doc1div').innerHTML = "<iframe id='doc1frame' src='doc2.html' frameborder='no' width='1000' height='40' scrolling='no' allowtransparency='true' background-color='transparent'></iframe>";
</script>
<!-- other doc1 content -->
</body>

Document 2
<html>
<head>
<script type="text/javascript">
<!--
window.onload=showDoc2;
function showDoc2()
{
if (document.getElementById(id);)
{
parent.doc1div.style.height="300";
}
else
{
parent.doc1div.style.height="40";
}
}
-->
</script>
</head>

<body>
<div id="doc2div1" z-index:500 position=absolute>
<dl><dt onMouseOver="javascript:showDoc2();">
<!-- content -->
</dt></dl></div>
</body>
</html>[/HTML]
Aug 12 '08 #1
Share this Question
Share on Google+
1 Reply


acoder
Expert Mod 15k+
P: 16,027
Use document.getElementById() to access elements. Just because you gave the element an ID doesn't mean you can access them by ID globally. IE's behaviour is incorrect here.
Aug 13 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.