Grow your CSS skills. Land your dream job.

jquery addclass , just a question.

  • # October 3, 2009 at 2:41 pm

    Hello all i’ve finally started to do some real jquery stuff instead of reading tutorial etc,

    so i noticed something.

    I write css like this

    ul.menu
    ul.menu li ul li

    In jquery there is this addClass(”) thing.
    Can i have something like addClass(‘ul.menu’) or it only accepts addClass(‘menu’)

    # October 3, 2009 at 4:30 pm

    It would only accept "menu" because menu is the only class you mentioned.

    ul.menu means literally a "ul" element (unordered list) with a "menu" class attribute.
    aka:

    Code:

      so "ul.menu" is not a class name.

      what exactly are you trying to accomplish, I may be able to help.

      # October 3, 2009 at 10:13 pm

      Thanks i really need some help here.
      I’ve attached the css, jquery code, html code all in 1 file below.

      WIthout jquery it works in all browsers which support li:hover but i’m trying to make it work with ie6 also.

      Code:
      < !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">




      # October 4, 2009 at 12:25 pm

      I don’t have IE6 to help test, but I don;t see why with that jQuery it wouldn’t work.

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

    You must be logged in to reply to this topic.

    *May or may not contain any actual "CSS" or "Tricks".