javascript - jQuery show&hide menu basics -


i'm trying make doble menu, click function , hide&show basics, don't understand why not working, can me out? here script:

$(document).ready(function() {  $('#work').click(function(event){     $(this).addclass("activado"); // add active class     $("#other,#contacto").removeclass("activado"); // remove active class     $("#menuother").hide();     $("#menuwork").show(); });  $('#other').click(function(event){     $(this).addclass("activado");     $("#work,#contacto").removeclass("activado");     $("#menuwork").hide();     $("#menuother").show(); });  $('#contacto').click(function(event){     $(this).addclass("activado");     $("#work,#other").removeclass("activado");     $("#menuwork").hide(); }); }); 

and html basic, don't think need it, script speaks self. active class working, hide & show not.

thanks lot.

//edit way, i'm hiding menus in css.

//edit adding html

<a href="#" id="work" class="inactivo">topmenu</a> <a href="#" id="other" class="inactivo">topmenu</a> <a href="#" id="contacto" class="inactivo">topmenu</a>  <div id="#menuwork"> <a href="#" id="submenu1" class="inactivo">submenu</a> <a href="#" id="submenu2" class="inactivo">submenu</a> <a href="#" id="submenu3" class="inactivo">submenu</a> </div>  <div id="#menuother"> <a href="#" id="submenu4" class="inactivo">submenu</a> <a href="#" id="submenu5" class="inactivo">submenu</a> <a href="#" id="submenu6" class="inactivo">submenu</a> </div> 

for starters, remove # id's in div elements. example:

<div id="#menuwork"> 

should be:

<div id="menuwork"> 

Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -