Ask and answer web development questions.

TinyDropdown2 - background change on hover

At the moment, the menu item will only highlight on hover when there are sub-menus below.

I would like to know what to change in order to get the menu to highlight (change background color)  even if it has no sub-menus on hover.

 

Thanks in advance, and apologies if this is a spazz question.
asked Jan 4 by anonymous

1 Answer

0 votes

Hello. This will work, but is not the best way to do it:

 

        <li><a href="#">Title</a>
            <ul>
            </ul>
        </li>
 
It makes a drop down with 0 entries. 
 
The other way is modifing the tinydropdown.css (just open it with a text editor):
 
Add after the line that says .menu li {....} the next 3 ones:
 
.menu li a, li.menuhover li a, li.menuhover li.menuhover li a {float:none; display:block; background:none; height:22px; padding-top:5px}
.menu li a:hover, li.menuhover li a:hover, li.menuhover li.menuhover li a:hover {background:#999; color:#fff}
.menu li span, li.menuhover li span, li.menuhover li.menuhover li span {float:none; display:block; background:none; height:22px; padding-top:5px}
 
As you can see this are the 3 ones that later on apear with the .menu ul li {....} tag.
I don“t have the time rigth now but some of the info in this 3 lines will be useless. Take 5 min to locate then, understand what is writen and erase then if you want.
Either way, the final index.html code you need to use should be something like this:
 
        <li><a href="#">One</a></li>
 
Hope this answer your question. The easiest and best is the 1 one because it stils alows you use the normal way.
 
Good day.
answered Jan 9 by anonymous
Removed by poster as not relevant to this topic - sorry.
Removed by poster as not relevant to this topic - sorry.