0

I'm a little confused right now. Firstly, the submenu's width and height looks distorted. Secondly, the javascript is not working. It does not hide the submenus and only appear when it's hover. The more funnier thing is that on my website the submenus don't even appear at all. I've been working on this for more than a day and I just can't seem to get it right.

#navigation ul li.current-menu-item a, 
#navigation ul li a:hover { background: rgba(255,255,255,0.05); }

#navigation ul li ul {
    position: absolute;
    top: 58px;
    left: 0px;
    width: 200px;
    border: none;
    z-index: 1000;
    background: #D32828;
}

JS fiddle: http://jsfiddle.net/UX94c/1/

2 Answers 2

1

Is there a particular reason why you're using javascript? It looks like a normal dropdown menu to me, which can be achieved with pure css:

.main-navigation li .sub-navigation {display: none;}
.main-navigation li:hover .sub-navigation {display: block;}

*you'll have to use your correct classes, my example is just the general use

I created a fiddle with the basic usage: http://jsfiddle.net/YP5Dh/

Sign up to request clarification or add additional context in comments.

Comments

1

I fixed your Javascript, there was a syntax error and had the css :

.sub-menu{
  visiblity:hidden;
}

The design is odd, but it works.

http://jsfiddle.net/bQ9DA/1

1 Comment

What do you mean it does not work? the sub-items do not appears? Which browser are you working with?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.