![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Aug 2005
Posts: 13
Rep Power: 0
![]() |
Need help with a realtime branching menu
I hope it's called a branching menu. I really have no experience with JavaScript, and I'm in DIRE need of a real time branching menu. When I say no experience, I mean, I can fiddle around with it, so I'd be grateful if someone could help me....
www.dashgaming.com/test You can see my pitiful attempt to create a menu there... What I want is for when I click Bew, a menu to pop up (like it does now). And, when I click Eep, for the Bew menu to go away, like it does now. However, I'm not sure that my code is efficient, and there's a lot of formatting problems (like the Eep not being right under the Bew) that I can't seem to fix. If someone could *please* write me a piece of code for a real time menu that does what http://www.shoprogers.com/store/wire...M5LSLET3SADKPB does, but in real time, and has lines seperating different <td>, I'd be totally grateful! Thanks in advance! |
|
|
|
|
|
#2 |
|
Expert Programmer
Join Date: Aug 2005
Location: Rotterdam, the Netherlands
Posts: 942
Rep Power: 4
![]() |
Well, i'm pretty sure no one in here is so bored to go writing code for anyone.
I've taken a look at your code though: <table width='140'>
<tr>
<td width='100%' class='menu'><a href="javascript:ShowMenu('1')">Bew</a></td></tr>
<td width='100%' class='main'><div id='menu_1' style='display:none'>
<table width='100%'>
<tr><td width='100%' class='main'>1</td></tr>
<tr><td width='100%' class='main'>3</td></tr>
<tr><td width='100%' class='main'>4</td></tr>
<tr><td width='100%' class='main'>5</td></tr>
</table>
</tr>
<tr>
<td width='100%' class='menu'><a href="javascript:ShowMenu('2')">Eep</a></td>
<td width='100%' class='main'><div id='menu_2' style='display:none'>f</div></td>
</tr>
</tableThis looks pretty fucked up. Al td's should have to be in a tr, and this is not the case everywhere in your code. A TR means Table Row, so you should use this one to continue on a new line. TD means Table Data, and this is the equavelent to a column. |
|
|
|
|
|
#3 |
|
Newbie
Join Date: Aug 2005
Posts: 13
Rep Power: 0
![]() |
Well, can you help me with unspacing the Bew and the Eep then please? =)
|
|
|
|
|
|
#4 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
What the hell do you mean by "real time"?? There is a LOT of sample menuing code on the web. Have you Googled with terms like Javascript and Menu?
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#5 | |
|
Expert Programmer
Join Date: Aug 2005
Location: Rotterdam, the Netherlands
Posts: 942
Rep Power: 4
![]() |
Quote:
![]() Welcome to the forums, btw |
|
|
|
|
|
|
#6 |
|
Newbie
Join Date: Aug 2005
Posts: 13
Rep Power: 0
![]() |
I just fixed the second part. I know what TDs and TRs are, and the second part was just me testing things and not bothering to fix it 'cause the first part wasn't working properly.
Any idea why there's a space...? Thanks for the welcome, and I did change the script so everything has a TR and TD. It's still spaced ![]() |
|
|
|
|
|
#7 |
|
Expert Programmer
Join Date: Aug 2005
Location: Rotterdam, the Netherlands
Posts: 942
Rep Power: 4
![]() |
what do you mean by 'spaced', actually?
|
|
|
|
|
|
#8 |
|
Newbie
Join Date: Aug 2005
Posts: 13
Rep Power: 0
![]() |
I attached a picture of the menu to the post. The space is where the red part is - you can compare it to the original =) www.dashgaming.com/test
I don't know why it's there... urgh. |
|
|
|
|
|
#9 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
OK... this doesn't even work for me. The <a> should be inside the <td>, not the other way around.
|
|
|
|
|
|
#10 |
|
Newbie
Join Date: Aug 2005
Posts: 13
Rep Power: 0
![]() |
Thank you. I put the <a> inside the <td> but I don't believe it makes too much of a difference. There's still a space =(
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|