...

View Full Version : I want to Resize frames on a button click



Var_javaMasta
10-12-2005, 04:54 PM
I tried this:

<INPUT TYPE="button" VALUE="Viewer" onClick="parent.setAttribute('cols', '963,*')">

and it's just not working.... what am i doing wrong? or are there any other methods that will work?

_Aerospace_Eng_
10-12-2005, 05:26 PM
Try

<INPUT TYPE="button" VALUE="Viewer" onClick="parent.document.getElementById('theframe').cols='963,*'">
Give the frameset that you want to control an id="theframe"

Var_javaMasta
10-12-2005, 05:43 PM
thankx sooo much... it worked

Pyth007
10-13-2005, 07:49 PM
FYI for others that may experience this problem... I found out that IE doesn't like setAttribute() to reset an existing attribute (or to set an attribute that IE defines by default (such as 'id'!). I had a similar problem when I was creating elements using DOM and trying to setAttribute('id', 'newIdName') and devised a work-around function to handle this situation:


function attributeSet(elem, attrb, setting)
{
var elemAttrb = elem.getAttributeNode(attrb);
if (elemAttrb)
{
elemAttrb.value=setting;
} else {
elem.setAttribute(attrb, setting);
}
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum