473,395 Members | 1,948 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How to hide the submenus

Hello

I have a html page with 2 layers,one for the main menu and the other
for the submenu.The submenu should be displayed on hovering on the main
menu is displayed else it should be hidden.

How can i get the above requirement using javascripts

can u plz give me the javascript code

Thanks In Advance

Poornima

Nov 21 '06 #1
2 1570
Poornima wrote:
Hello

I have a html page with 2 layers,one for the main menu and the other
for the submenu.The submenu should be displayed on hovering on the main
menu is displayed else it should be hidden.

How can i get the above requirement using javascripts

can u plz give me the javascript code

Thanks In Advance

Poornima
showing and hiding can be done by setting obj.style.display to either
"", or "none".

--
Martijn Saly
Nov 21 '06 #2
ASM
Poornima a écrit :
Hello

I have a html page with 2 layers,one for the main menu and the other
for the submenu.The submenu should be displayed on hovering on the main
menu is displayed else it should be hidden.

How can i get the above requirement using javascripts
why not with css ?

a span { display: none }
a:hover span { display: block }
<a href=" ...>menu 1
<span>
<a href=" ...>submenu 1.1</a>
<a href=" ...>submenu 1.2</a>
</span>
</a>
can u plz give me the javascript code
HTML :
=======
<p><a onclick="show('d_1')" href=" ...>menu 1</a></p>

<div id="d_1" onclick="show(this.id)">
<p><a href=" ...>submenu 1.1</a>
<p><a href=" ...>submenu 1.2</a>
</div>

JavaScript :
============
function show(divId) (
divId = document.getElementById(divId).style;
divId.display = divId.display==''? 'none' : '';
}

onload = function() { show('d_1'); }

(not tested)
--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
Nov 21 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Venkatesh | last post by:
Hi Everybody, This is the first timw I am entering into this Group. I am developing a VB Project with an MDI form. I want to display IE Favorites into my application. For this I need to...
2
by: John Doe | last post by:
Hey, Im working on a javascript based menu system : http://larsandre.mine.nu/menu2.htm When the user first selected a menu-item the sub-menu appears nicly but if the user then moves the cursors...
0
by: paula | last post by:
I've got a problem with asp.net i am trying to make a menu control. and have searched the web for serveral controls but they don't work correctly. I am pretty new to asp.net building. What am i...
1
by: paulakeijzers | last post by:
I've got a problem with asp.net i am trying to make a menu control. and have searched the web for serveral controls but they don't work correctly. I am pretty new to asp.net building. What am i...
4
by: paula | last post by:
I've got a problem with asp.net i am trying to make a menu control. and have searched the web for serveral controls but they don't work correctly. I am pretty new to asp.net building. What am i...
6
by: Larry Woods | last post by:
I am trying to name my submenus (MainMenu control) and they show up in the menu dropdown...like they are O.K., but when I check my controls the names are still "MenuItemX". OTOH, the top-level...
0
Denburt
by: Denburt | last post by:
This code is for a Toggle Button layout on a form, with this code you can set a number of toggle buttons visible and have multiple submenus that will stay hidden when not in use. My main menu is set...
3
by: preethamsaroja | last post by:
can anybody plz, send m the code for menus& submenus or else tell m how to write code in webform using vb.net..............plz its very urgent.....
2
N002199B
by: N002199B | last post by:
Hie Guru's I am trying to write code that can be re-used by simple calls to build menus and submenus on mobile devices. I have heard about the cascading menus design pattern, but do not...
8
by: Meri | last post by:
Hello Everybody on the internet seems to think this is a problem with IE but for me it works fine with IE, but the submenus do not appear with Firefox andOpera. The html is a simple list with...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.