SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Aug 2010
    Location
    Wilmette, IL
    Posts
    120
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    jquery drop down menu href trouble

    I'm developing a site where the client needs a drop down nav <ul> menu. I'm using a jquery drop down menu I got out of the Sitepoint book "From Novice to Ninja" to do this, and it all works just fine except for the actual href= aspect. The drop menu animation is functioning perfectly, but when the actual links are clicked on, the target url doesn't load. Just trying to get the links to function.

    Being new to jquery and javascript, I'm probably overlooking something simple ... like event propagation or something.

    Here's the test url. The only two pages I have live are index.php and scp.php so we'll have to conduct our test by clicking back and forth between those.

    http://www.savagepixels.com/testSite/

    The code from my jquery config script file is below:
    __________________________________________

    // drop down menu functionality
    $(document).ready(function(){
    $( '#menu > li > ul' )
    .hide();
    $('#menu > li').toggle(function(){
    $(this).find('ul').slideDown();
    }, function(){
    $( this ).find('ul').slideUp();
    });
    });

  2. #2
    SitePoint Zealot
    Join Date
    Aug 2010
    Location
    Wilmette, IL
    Posts
    120
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This issue has been resolved via another forum. Here's the correct code and thanks to all who helped.

    // drop down menu functionality
    $(document).ready(function(){
    $( '#menu > li > ul' )
    .hide()
    .click(function( e ){
    e.stopPropagation();
    });
    $('#menu > li').toggle(function(){

    window.location=$(this).find("a").attr("href"); return false;

    $(this).find('ul').slideDown();
    }, function(){
    $( this ).find('ul').slideUp();
    });
    });


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •