Changing a frame's width from script
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.
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.
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!
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.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)