treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Convert a Menu to Drop Down menu for small screens (problem)

  • Hi,

    I have added the jquery plugin to convert the navigation into a drop down menu in small screens. I am using the one that has nested 's. Anyway, I am having trouble with the pages not linking correctly. Once it converts the nav it links to the "text". For example the link becomes: www.website.com/-about
    I also noticed that the example provided is doing the same thing. Here is the link to the demo: http://css-tricks.com/examples/ConvertMenuToDropdown/optgroup.php

    Anyway, I was wondering if I could get some help getting it to work or if you knew of a better plugin that actually works.
    I appreciate the help.

    Thanks again,
    Mayra
  • do you have actual values in the href? the demo doesnt but yours should. It basically takes the href atrributes from the links and puts them into the .val() also the the selector that comes with the plug in is:
    $("nav a")

    so if your using a different element to wrap your nav then u need to update this. for example:
    $("ul a")