Results 1 to 4 of 4

Thread: Changing a frame's width from script

  1. #1
    Join Date
    Dec 2003

    Angry Changing a frame's width from script

    Hi all-

    Anyone know how to change the width of a standard frame from script? Picture a left frame containing a menu and a right frame containing content.

    I want the user to be able to "minimize" the left frame containing the menu without grabbing/dragging the border...quick click and it's minimized. Tried all kinds of tricks to alter the frame's width from script, but no joy so far.


  2. #2
    Join Date
    Nov 2003
    Have you tried doing some sort of onClick with locating that frame you want to resize through the DOM with document.frames and all that? Figuring out the width and height of the frame, storing that data in two variables, then calling up that data...?

    I'm not too sure, good luck. Someone more advanced than me will easily be more helpful.
    Coming soon as well...it's all comnig soon.

  3. #3
    Join Date
    Dec 2003

    Thumbs up

    Tried a couple methods, finally got it.

    Frameset with 2 frames (columns):

    window.parent.document.all.tags("FRAMESET").item(0).cols = "[new size], *"

    Will also work, but frameElement is IE 5.5 or higher:
    window.frameElement.parentElement.cols = "[new size], *"

    Gonna fire the event in the onClick for a pretty "minimize menu" image. Pretty cool, can make some pinned/unpinned menus ala Viz Studio .NET.

    Thanks for the assist!

  4. #4
    Join Date
    Jul 2003
    Boston Area, Massachusetts
    Note that your method will only work in IE (hence the use of document.all). This is a huge problem if you're concerned about your site working in multiple browsers.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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