Results 1 to 4 of 4

Thread: DD Accordion: How do I apply different CSS to the currently selected submenu item

  1. #1
    Join Date
    Mar 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default DD Accordion: How do I apply different CSS to the currently selected submenu item

    1) Script Title: DD Accordion

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...ordionmenu.htm

    3) Describe problem:

    I'd like to know how I can modify the accordion script so that I can use different CSS on the currently selected submenu item.

    ie.

    Menu A
    submenu 1
    submenu 2 (currently selected)
    submenu 3


    I want a different background color for submenu 2 but there is no support for that in current script code.

  2. #2
    Join Date
    Aug 2004
    Posts
    9,910
    Thanks
    3
    Thanked 969 Times in 957 Posts
    Blog Entries
    15

    Default

    Are your sub menus also part of the accordion menu? In other words, do they expand/ contact with the animation in place? If so, applying a specific CSS class to the selected sub menu is no different than applying a CSS class to the main accordion menu headers, since each level of your menus is a separate instance of accordion menu. See nested accordion menu here: http://www.dynamicdrive.com/forums/s...ad.php?t=29611

  3. #3
    Join Date
    Mar 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Sorry, I sort of used the wrong language to describe my problem. I should have said different CSS for current submenu item.



    For example, in the above menu, if the user is currently on the Upload Photo page, then I want the Photo link between Video and Audio to have a different background color.

  4. #4
    Join Date
    Aug 2004
    Posts
    9,910
    Thanks
    3
    Thanked 969 Times in 957 Posts
    Blog Entries
    15

    Default

    Hmm there's no way to "automate" the selection of the sub menu item the user is currently on with Accordion Menu script. It's actually a separate issue. What you basically want to do is somehow give the selected sub menu the desired CSS classname:

    Code:
    <li><a href="#" class="selected">Photo</a></li>
    How you go about doing this though, whether manually or automatically, depends entirely on you.

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
  •