Collapsing a list but making the header not link if there is a child

Collapsing a list but making the header not link if there is a child

I have the following list setup I want to toggle open and close a section. This is working with the code I have below except except when you click on the menu item that slides it links to the page. When I set the return to false then all the other links in the list stop working. I think I need to do some <If then> to determine if it is a child but I am so new I am lost. Your help will be appreciated.
  1. ul class="menu"
        li class="menu-item" 
  2.       a herf
            ul class="sub-menu"
                li class="menu-item"
                    a href




  1. jQuery(document).ready(function($) {
  2. $('.menu > li > ul').hide();
  3. $(".menu > li > a").click(function(){
  4. // slide toggle effect
  5. $(this).next(".menu > li > ul").slideToggle("slow");
  6. return true;
  7. });
  8. });