 |
Javascript How-To Ask your "How do I do this with Javascript?" questions here. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|

October 15th, 2004, 02:09 PM
|
Authorized User
|
|
Join Date: Jun 2004
Posts: 99
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Sub menu
Hi, I have a rows of label (for linking), and I want to show the sub menu after the mouse cursor is pointed over one of the labels, how to do this in javascript?
|

October 15th, 2004, 03:53 PM
|
Friend of Wrox
|
|
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
|
|
You would normally have a <div> next to the menu that's visibility is set to hidden, and then onmouseover the label, the visibility is set to visible.
Let me know if you need more of an explanation.
-Snib <><
Try new FreshView 0.2!
There are only two stupid questions: the one you don't ask, and the one you ask more than once ;)
|

October 16th, 2004, 01:37 AM
|
Authorized User
|
|
Join Date: Jun 2004
Posts: 99
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Ya, I would like to have more explanation on that. So, do I need to have a second column of cell to "contain" the hidden sub menu? Let say, in HTML, I have this:
<table>
<tr><td width = "150">Menu</td>
<td>Sub Menu 01</td></tr>
<tr><td width = "150"> </td>
<td>Sub Menu 02</td></tr>
</table>
Is the idea above correct where I use two <td> tags to keep the sub menu which are to be set hidden later? If yes, so where shall I place the <div> tags? Anyhow, I would appreciate much if you can show me some coding on this problem.
Thank you.
|

October 18th, 2004, 08:49 PM
|
Friend of Wrox
|
|
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
|
|
Here's an example:
<div onmouseover='document.getElementById("submenu").st yle.display="block"'>submenu ></div>
<div style='display:none' onmouseout='this.style.display="none"' id='submenu'>this<br/>is<br/>a<br/>sub<br/>menu</div>
Hopefully this will give you some idea....
-Snib <><
Try new FreshView 0.2!
There are only two stupid questions: the one you don't ask, and the one you ask more than once ;)
|

October 19th, 2004, 05:35 PM
|
Authorized User
|
|
Join Date: Jun 2004
Posts: 99
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks ya, snib. The site that you suggest to me is really useful. Maybe I have only a very basic javascript knowledge, so I still need times to understand those javascript provided by dynamicdrive.com, it is really a good site.
|
|
 |