Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to resize Window, move buttons

Status
Not open for further replies.

rf222

Programmer
Jan 29, 2004
94
US
I would like to have an Advanced button on the screen.

1 )When user clicks Advanced it would resize window and move all all buttons down.

2) Advanced button label would change to Basic.

3) When user clicks Basic it would resize button back to the original size and move buttons back to their original position.

Any idea how to do it ?

 
rf222,

This should do the job for you:

Code:
<html>
<head>
<script type="text/javascript">
<!--
	function toggleAdvanced()
	{
		var buttonObj = document.forms['myForm'].typeButton;
		if (buttonObj.value == "Advanced")
		{
			buttonObj.value = "Basic"
			document.getElementById('advancedSection').style.display = 'block';
		} else {
			buttonObj.value = "Advanced"
			document.getElementById('advancedSection').style.display = 'none';
		}
	}
//-->
</script>
</head>
<body>
	<form name="myForm">
		<input type="button" name="typeButton" value="Advanced" onclick="toggleAdvanced();">
		<div id="advancedSection" style="display:none;">
			This is the advanced section
			<input type="button" name="dummyButton1" value="Button 1">
			<input type="button" name="dummyButton2" value="Button 2">
			<input type="button" name="dummyButton3" value="Button 3">
		</div>
	</form>
	Dummy text...
</body>
</html>

Hope this helps,
Dan
 
OK great. Thanks a lot. I got an idea.

Just courious. How would you move the Advanced/Basic buttons in the docoment? Is there a method Move ?

 

It depends on what you mean by "move them". You can move them simply by changing where they are in the document.

Describe what you mean by "move" and I'll tell you if it can be done or not.

Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top