Forum Moderators: open

Message Too Old, No Replies

Anyone knows how to accomplish this?frame resizing/toggling trouble

Resize a frame anyone? :-(

         

haryanto

10:03 pm on Feb 17, 2005 (gmt 0)

10+ Year Member



HI guys,

I have managed to slap up the codes to show/hide a menu frame.
Deep inside, I know I wanted something better.
Instead of having SHOW MENU/HIDE MENU buttons, I wanted it to detect if the frame is shown/hidden and do the opposite. e.g. when a menu is shown and the 'TOGGLE' button is clicked, it will hide the menu.

Does anyone know how to accomplish this?

The code:

<frameset cols="*,80" frameborder="NO" border="0" framespacing="0">
<frame src="menu.php" name="mainFrame">
<frame src="main.php" name="rightFrame" scrolling="NO" noresize>
</frameset>
<noframes>
<body>
</body>
</noframes>

content of main.php

<input type="button" value="hide menu" onClick="parent.document.body.cols='0,*'">
<input type="button" value="show menu" onClick="parent.document.body.cols='175,*'">

orion_rus

9:53 am on Feb 18, 2005 (gmt 0)

10+ Year Member



hmm)) u can stay it like so:

<input type="button" value="hide/show menu" onClick="parent.document.body.cols=(parent.document.body.cols=='0,*')?parent.document.body.cols='175,*':parent.document.body.cols='0,*'">

i think it should work) good luck to you
p.s may be instead of == you should try to use === try it if it first didn't work

haryanto

1:34 am on Feb 19, 2005 (gmt 0)

10+ Year Member



F***in awesome. It works!

We dont even need the ===.
Thanks a bunch!