PDA

View Full Version : Dropdown Menu Hover Question



Elbee
09-09-2010, 04:49 PM
1) Script Title: Dropdown HTML control

2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex1/dropdowncontrol.htm#
Example 1

3) Describe problem:
I have started this new thread because the other questions I had which have not been answered yet, I have figured out. There is one I cannot figure out.
When your mouse hovers over a link, it is a gold color.

1. I cannot figure out where to change that color.
2. Out of nine links that I have so far, only two of them do not show the highlight on hover in IE7 (interestingly the first one in menu1 and the last one in menu 3).
3. All of the links are transparent when the mouse hovers over the links in Firefox.

I am attaching images of what I am talking about.

Thank you for your help.

ddadmin
09-09-2010, 07:00 PM
It's possible another CSS definition on your page is over-ruling the style defined for the drop down menu control on your page, resulting in some of the inconsistent link colors you're seeing. Have you tried using CSS's "!important" declaration to make sure the desired CSS rule is given priority over any overlapping styles? Given the below markup for a drop down menu control:


<div id="menu_parent">Main Menu</div>

<div id="menu_child">
<a href="#">Item 1</a>
<a href="#">Item 2</a>
<a href="#">Item 3</a>
</div>

<script type="text/javascript">
at_attach("menu_parent", "menu_child", "hover", "y", "pointer");
</script>

The part of your CSS that styles its hover state might be modified with the code in red:


#menu_child a:hover{
background-color: lightyellow !important;
}

to ensure that rule takes precedence over all else.

Elbee
09-09-2010, 07:36 PM
Thanks for your response.

I placed the code you gave me into my css file.....it worked almost beautifully. One very strange thing happened. I'll attach an image.
The child menu item 1 and 3 had a red background (which I asked for)and the white fonts; but the item 2 had the yellow highlighted fonts with the red background.

What would cause this?

Thanks for your help, Elbee

Elbee
09-09-2010, 07:55 PM
Thanks for your response.

I placed the code you gave me into my css file.....it worked almost beautifully. One very strange thing happened. I'll attach an image.
The child menu item 1 and 3 had a red background (which I asked for)and the white fonts; but the item 2 had the yellow highlighted fonts with the red background.

What would cause this?

Thanks for your help, Elbee