View Full Version : Keeping parent item hovered while hovering child items on drop down menu

10-30-2010, 06:21 PM
Hi, I have a drop down menu that's given like this:


<ul id="navbar">
<li><a href="profile.php"><img src="images/profile3.jpg" onmouseover="this.src='images/profilehover3.jpg'" onmouseout="this.src='images/profile3.jpg'" </a><ul>
<li><a href="#">Edit Profile</a></li>
<li><a href="#">Change Picture</a></li>
<li><a href="#">Something else</a></li></ul>


#navbar {
margin: 0;
padding: 0;
height: 0em; }
#navbar li {
list-style: none;
float:left; }
#navbar li1 {
list-style: none;
float:right; }
#navbar li a {
display: block;
padding: 0px 0px;
background-color: #5e8ce9;
color: #fff;
text-decoration: none;}

#navbar li ul {
width: 10em; /* Width to help Opera out */
background-color: limegreen;}
#navbar li:hover ul {
display: block;
margin: 0;
padding: 0; }
#navbar li:hover li {
float: none; }
#navbar li:hover li a {
background-color: limegreen;
border-bottom: 1px solid #fff;
color: #000; }
#navbar li li a:hover {
background-color: #1fb0f3; }

I get the drop down to work just fine, and the profile button to hover when my mouse is over it. However, I would like the profile button to stay hovered as long as my mouse is going through the items in the drop down menu.

Is this possible?

Thank you in advance!

10-30-2010, 07:40 PM
With the language being used it doesn't look like you can. The 'hover' event for the profile button is really a javascript onmouseover and onmouseout and is only attached to the image itself, you would need to add quite a bit more code and change quite a few things to make it work the way you want. I do notice that your image tag is missing the end > , but I don't think that will make it work differently?

11-16-2010, 02:06 AM
I don't understand... this is not a bot doing this but a real person. Someone had to take the time to register on this forum and this is the crapp reason?

jhjkhjh, do you think that I, or anyone, is going to run over to www.powerwhateverthe**** and spend some money? Really?