Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
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
  #1 (permalink)  
Old October 15th, 2004, 02:09 PM
Authorized User
 
Join Date: Jun 2004
Location: Georgetown, Selangor, Malaysia.
Posts: 99
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to hlchuah77
Default 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?

  #2 (permalink)  
Old October 15th, 2004, 03:53 PM
Friend of Wrox
 
Join Date: Nov 2003
Location: , , .
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

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 ;)
  #3 (permalink)  
Old October 16th, 2004, 01:37 AM
Authorized User
 
Join Date: Jun 2004
Location: Georgetown, Selangor, Malaysia.
Posts: 99
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to hlchuah77
Default

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">&nbsp;</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.



  #4 (permalink)  
Old October 18th, 2004, 08:49 PM
Friend of Wrox
 
Join Date: Nov 2003
Location: , , .
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Here's an example:

<div onmouseover='document.getElementById("submenu").st yle.display="block"'>submenu &gt;</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 ;)
  #5 (permalink)  
Old October 18th, 2004, 08:50 PM
Friend of Wrox
 
Join Date: Nov 2003
Location: , , .
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Also, I forgot to mention this extremely useful page:

http://www.dynamicdrive.com/dynamicindex1/index.html

-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 ;)
  #6 (permalink)  
Old October 19th, 2004, 05:35 PM
Authorized User
 
Join Date: Jun 2004
Location: Georgetown, Selangor, Malaysia.
Posts: 99
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to hlchuah77
Default

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.



Similar Threads
Thread Thread Starter Forum Replies Last Post
CH 15 Context Menu - Element Menu Items Razzy The Pug BOOK: Ivor Horton's Beginning Visual C++ 2005 2 November 9th, 2008 03:53 PM
how create menubar, menu, menu item in xsl vijayanmsc XSLT 1 June 5th, 2006 06:43 AM
Menu Help in statusbar at mousemove over Menu item Kaustav VB Components 1 September 14th, 2005 09:28 AM
right click menu hidden by drop-drown menu Andraw HTML Code Clinic 0 March 18th, 2005 03:28 PM
Changing Menu made with VB 4 Menu Editor Zooker VB How-To 1 July 26th, 2003 11:44 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.