Treehouse: Grow your CSS skills. Land your dream job.

simple jquery dropdown

  • # December 17, 2011 at 6:42 pm

    I’m trying to get this to work on this site and failing – it looks like it should be simple enough to implement but I can’t see where I’m going wrong. any suggestions? thanks.

    # December 17, 2011 at 7:59 pm

    Well, for starters, you’re not calling the main jQuery library file anywhere…that’s an essential part.

    # December 17, 2011 at 8:13 pm

    at the top, about the 8th line down

    . I use this for anything slider, can’t I also use it for the dropdown?

    # December 17, 2011 at 8:34 pm

    Wasn’t there first time I checked…?? Anyhoo, yes, you can use this for any jQuery plugin, it’s the main part of anything jQuery so that can’t be the source of the problem.

    # December 18, 2011 at 12:57 am

    Simple, most importantly, you dont have the subMenu UL inside of the parent dropdown LI….go here for working example:

    any questions let me know!

    # December 18, 2011 at 4:23 pm

    @kgscott284 – thanks for the reply. I can see on jsFiddle how nicely your solution works but I can’t get it to work. I tried putting the jquery into an external file and putting it internally but neither is working. I hope its not due to a typo but if you wouldn’t mind looking here maybe you can see my error. Also can you explain if the zoom property is necessary and what does this line do

    $("ul.dropdown li ul li:has(ul)").find("a:first").append(" » ");

    ? do I need it? Many thanks!

    # December 18, 2011 at 9:24 pm

    That code is to insert an » on the li elements that has children ul. That’s used to make automatic submenu indicators.

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.