Forum Moderators: open
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,*'">
<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,*'">