Jump to content

[solvet] js - toogle in category


Recommended Posts

i want make slide only in second ul in my category

i done:

   $('ul li ul li').click( function() {
  $(this).children('ul').toggle(); 
  if ((this).children('ul')){
  return false; 
   }
   else{return true;}
  });  



but i have one prolbem li in second ul dont open because return false what condition i must write do work??
if ((this).children('ul')) - its not work :<

SOLVET:

   $('ul.tree li ul li a').click( function() 
  { 
     if($(this).parent().children('ul')[0]) 
     {
      // $(this).parent().parent().children('li ul li').slideUp();
       if($(this).parent().children('ul').css('display')!='block') 
       {
          $('.active').slideUp();
          $('.active').removeClass('active');
          $(this).parent().children('ul').slideToggle(); 
          $(this).parent().children('ul').addClass('active');
       }
       return false; 
     }else
     {
       return true;  
     }
  }
  );  

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...