Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Apr 2005
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    I want to Resize frames on a button click

    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?

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Try
    Code:
    <INPUT TYPE="button" VALUE="Viewer" onClick="parent.document.getElementById('theframe').cols='963,*'">
    Give the frameset that you want to control an id="theframe"
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    New to the CF scene
    Join Date
    Apr 2005
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thankx sooo much... it worked

  • #4
    Regular Coder
    Join Date
    Sep 2005
    Posts
    535
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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:
    Code:
    function attributeSet(elem, attrb, setting)
    {
     var elemAttrb = elem.getAttributeNode(attrb);
     if (elemAttrb)
     {
       elemAttrb.value=setting;
     } else {
       elem.setAttribute(attrb, setting);
     }
    }


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •