dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: Active menu background color

Hybrid View

  1. #1
    Join Date
    Jul 2012
    Posts
    2

    Smile Active menu background color

    I have a vertical menu. It is .glossymenu . The menu item is accessed using css as .glossymenu a.menuitem . I want to change the background color when the menu item is selected or when the menu item is active. I am trying to use the following JQuery:
    $(".glossymenu a.menuitem").click(function(){
    $(this).siblings(".active").removeClass("active");
    $(this).addClass("active");
    });
    But, I am unable to resolve my issue using this. Any ideas, how to change the background color of the menu item, when it is selected. It should not change when we click outside the menu item in blank area, when the menu is active.

    can I use css active class like:

    glossymenu a.menuitem.active

    Thanks, Prasad

  2. #2
    Join Date
    Jul 2012
    Posts
    2
    My HTML code for the menu is as follows: <div class="glossymenu"> <a class="menuitem" href="#">Home</a> <a class="menuitem submenuheader" href="#">Text Pages</a> <div class="submenu"> <ul> <li><a href="#">Menus</a></li> <li><a href="">Menus</a></li>

    glossymenu is the main class, menuitem is sub class for both expandable and non expandable menu's. class="menuitem submenuheader" is for the expandable classes. Thank you once again.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles