garrensilverwing
New Member
- Messages
- 148
- Reaction score
- 0
- Points
- 0
Hi guys. I am working on creating an online store type program for practice and I want to create a page where people can go in and edit the store by adding/removing items and changing the color schemes. I know this part of the program will be javascript heavy considering what i want it to do. Anyway I am stuck here on this part because I am pretty bad at javascript. What I want to do is make it so there are three tabs at the top of the divs and when they click on one of the tabs the corresponding div becomes visible, the other two divs become hidden and the tabs change to match (the clicked one gets a white background and loses the border-bottom). I was close with my javascript attempts but I am getting frustrated, please help!
here is the code:
here is the code:
HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Edit</title>
<style type="text/css">
.Wrapper {position: relative; margin-right: auto; margin-left: auto; width: 500px;}
.ChangesTable {width: 100%; margin: none; padding: none; border-collapse: collapse;}
.AddItems {background: #FFF; border-bottom: none; border-top: 1px #686868 solid; border-right: 1px #686868 solid; border-left: 1px #686868 solid;}
.RemoveItems {background: #D3D3D3; border-bottom: 1px #686868 solid; border-top: 1px #686868 solid; border-right: 1px #686868 solid; border-left: 1px #686868 solid;}
.ColorScheme {background: #D3D3D3; border-bottom: 1px #686868 solid; border-top: 1px #686868 solid; border-right: 1px #686868 solid; border-left: 1px #686868 solid;}
.DivAddItems {padding: 10px; left: -1px; border-collapse: collapse; position:relative; width: 479px; border-bottom: 1px #686868 solid; border-right: 1px #686868 solid; border-left: 1px #686868 solid;}
.DivRemoveItems {padding: 10px; display:none; left: -1px; border-collapse: collapse; position:relative; width: 479px; border-bottom: 1px #686868 solid; border-right: 1px #686868 solid; border-left: 1px #686868 solid;}
.DivColorScheme {padding: 10px; display:none; left: -1px; border-collapse: collapse; position:relative; width: 479px; border-bottom: 1px #686868 solid; border-right: 1px #686868 solid; border-left: 1px #686868 solid;}
</style>
</head>
<body>
<div name="Wrapper" class="Wrapper">
<table name="ChangesTable" class="ChangesTable">
<tr>
<td name="AddItems" class="AddItems">Add Items</td>
<td name="RemoveItems" class="RemoveItems">Remove Items</td>
<td name="ColorScheme" class="ColorScheme">Color Scheme</td>
</tr>
</table>
<div name="DivAddItems" class="DivAddItems">
<form method="post" action="AddItems.php">
<label>Item Name</label><br /><input name="ItemName" type="text" /><br />
<label>Price</label><br /><input name="ItemCost" type="text" /><br />
<label>Brief Description</label><br /><textarea name="ItemDescription"></textarea><br />
</form>
</div>
<div name="DivRemoveItems" class="DivRemoveItems">
</div>
<div name="DivColorScheme" class="DivColorScheme">
</div>
</div>
</body>
</html>