Page 1 of 1
change iFrame height
Posted: Mon May 02, 2005 4:50 pm
by Jr
I was just wondering how I would increase/decrease the height of an iFrame with a button/link. The code below is what I tried (but obviously doesn't work). Is there anywhere I can go to learn a little of this kind of JavaScript (onclick, onmouseover, etc.) dealing with objects?
Code: Select all
print "e;<iframe name='iframe_test' width='100%' marginwidth='0' align='left' height='100px' src='home.php' scrolling='yes' align=left frameborder=0 hspace=0 vspace=0> </iframe>"e;;
print "e;<a href='#' onclick=\"e;parent.iframe_test.height ='250';\"e;><br>Link 2</a>"e;;
Posted: Mon May 02, 2005 4:56 pm
by hawleyjr
resizes Iframe according to content
http://archivist.incutio.com/viewlist/css-discuss/45869
Code: Select all
function resizeMe(obj){
var Objname = eval(obj.name+"e;"e;);
docHeight = Objname.document.body.scrollHeight
obj.style.height = docHeight + 'px'
}
Posted: Mon May 02, 2005 4:58 pm
by shiznatix
hummmmmm im not sure but is there a specific reason why you want to do this? i recently had a lot of problems with resizing a iframe based on the size of the page within the iframe. i know there is a bunch of stuff about this in google if you search, i found a million articles when i had that problem
EDIT: my post is useless since im far too slow

Posted: Mon May 02, 2005 5:28 pm
by Jr
Sorry if I worded that wrong guys.

I dont want to resize the iFrame depending on the size of the page I want to resize it 'onclick' of a link/button.
Posted: Mon May 02, 2005 6:05 pm
by Jr
ok, I found this but I want to increment and deincrement this with an iFrame.
Code: Select all
function setHeight()
{
var x=document.images
xї0].height="e;250"e;
}
</script>
<img src="e;compman.gif"e; width="e;107"e; height="e;98"e; />
<form>
<input type="e;button"e; onclick="e;setHeight()"e; value="e;Change height"e;>
</form>
Posted: Tue May 03, 2005 5:59 am
by shiznatix
Posted: Tue May 03, 2005 8:17 am
by Chris Corbyn

Moved to Client-side
Posted: Tue May 03, 2005 2:40 pm
by Jr
hmm... thats almost what I need shiznatix except that seems even more complicated then what I'm looking for. I dont need to change the size depending on the content inside. I just need to increment the size (e.g. by 100px or so). Hmm... Doesn't anyone know JS on this forum? I'm sure SOMEone has done this somewhere right?
Posted: Tue May 03, 2005 3:08 pm
by Jr
Ok... *phew*... I FINALLY found "kind-of" what I'm looking for (that works), BUT... I just dont know how to increment it. can someone help with that? Here it is...
Code: Select all
<iframe width='100%' height='100px' src="e;test_1.php"e; id="e;mxhIframe"e;></iframe>
<?
print "e;<a href='#' onclick=\"e;parent.document.getElementById('mxhIframe').style.height = '500';\"e;>Increase</a>"e;;
print "e;<br><a href='#' onclick=\"e;parent.document.getElementById('mxhIframe').style.height = '200';\"e;>Decrease</a>"e;;
?>