• When I create a menu, there is autmatically a div created with the specific name “#menu-“name””. In this menu I’m using images with a hover and I want to use the current class. So, I’ve given each menu-item its own class, so I can point the correct image as a background. So far so good. But the problem is there with the current class. When I apply the current class to the created div “#menu-“name””, its working. But when I add the specific class for the menu-item, each item has his own inage, then it doen’t work anymore. It falls back to the default image.
    I’m using a build in menu from wordpress.

    Does anyone know how to achieve this?

    My test-site is on http://bit.ly/WMAuQc

    The used code is

    #menu-collega li {
    	width:360px;
    	list-style:none;
    	margin-left:-15px;
    	position:relative;
    	z-index:20;
    	text-indent:-999em;
     	overflow:hidden;
    }
    
    #menu-collega .coll1 a, #menu-collega .coll2 a {
    	display: block;
    	width:338px;
    	height:113px;
    	position:relative;
    	z-index:20;
    }
    
    #menu-collega .coll1 a {background: url('images/colmenu/jk-zw.png');}
    #menu-collega .coll1 a:hover {background: url('images/colmenu/jk-c.png');}
    
    #menu-collega .coll2 a {background: url('images/colmenu/nd-zw.png');}
    #menu-collega .coll2 a:hover {background: url('images/colmenu/nd-c.png');}
    
    #menu-collega .coll1  .current_page_item > a,
    #menu-collega .coll1  .current_page_ancestor > a,
    #menu-collega .coll1  .current-menu-ancestor > a,
    #menu-collega .coll1  .current-menu-item > a,
    #menu-collega .coll1  .current-menu-parent > a {
    	background: url('images/colmenu/jk-c.png');
    }
    
    * html #menu-collega .coll1 .current_page_item a,
    * html #menu-collega .coll1 .current_page_ancestor a,
    * html #menu-collega .coll1 .current-menu-ancestor a,
    * html #menu-collega .coll1 .current-menu-item a,
    * html #menu-collega .coll1 .current-menu-parent a,
    * html #menu-collega .coll1  a:hover {
    	background: url('images/colmenu/jk-c.png');
    }

    I would really appreciate some help….

Viewing 4 replies - 1 through 4 (of 4 total)
  • there is no sign of that menu in the linked site;

    can you post a link to a page where this menu is active?

    Thread Starter erwin_m

    (@erwin_m)

    I’ve checked it and in on my comp the menu is in the sidebar. Its the menu with the two people in black/white, when hovering it gets his colour.

    .coll1 and .current-menu-item are in the same element;
    therefore no spaces in the styles (example):

    #menu-collega .coll1.current_page_item > a,

    etc.

    Thread Starter erwin_m

    (@erwin_m)

    Didn’t know that about thtat spaces. This was my problem indeed,it’s working now. Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Problem with .current and image-menu’ is closed to new replies.