logo-dw

Go Back   Dreamweaver Club Forums > Dreamweaver forums > Spry
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 09-27-2010, 06:19 PM   #1
tacotac
 
Join Date: Sep 2010
Location: Beach Park, IL
Posts: 6
Default Hover the same in Submenus and menus

I am going to scream! I have tried everything from making ul's to li's, etc. and I can't find the magic solution to this puzzle! I have a gradient on the main menu, and it's own hover, but I don't want that hover in my submenu too. I want the submenu hover to just be a solid color. I am trying to isolate it by adding a ul hover, among other things, but obviously I am not doing something right. What is it I am doing wrong?!?!?! I'm not sure all you have to look at, but here is the code on the spry css, and link to the site.

http://www.tacotac.net/ajsafety/


/* The outermost container of the Menu Bar, an auto width box with no margin or padding */
ul.MenuBarHorizontal
{
width: 950px;
text-align: center;
margin-top: 0px;
margin-right: auto;
margin-bottom: 0px;
margin-left: auto;
}
/* Set the active Menu Bar with this class, currently setting z-index to accomodate IE rendering bug: http://therealcrisp.xs4all.nl/meuk/IE-zindexbug.html */
ul.MenuBarActive
{
z-index: 1000;
}
/* Menu item containers, position children relative to this container and are a fixed width */
ul.MenuBarHorizontal li
{
text-align: center;
width: auto;
height: 40px;
list-style-type: none;
display: block;
float: left;
white-space: nowrap;
padding-right: 5px;
padding-left: 5px;
}
/* Submenus should appear below their parent (top: 0) with a higher z-index, but they are initially off the left side of the screen (-1000em) */
ul.MenuBarHorizontal ul
{
margin: auto;
padding: 0;
list-style-type: none;
font-size: 100%;
z-index: 1020;
cursor: default;
width: auto;
position: absolute;
left: -1000em;
}
/* Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to auto so it comes onto the screen below its parent menu item */
ul.MenuBarHorizontal ul.MenuBarSubmenuVisible
{
left: auto;
background-color: #FF6230;
border: 2px solid #FFA07F;
}
/* Menu item containers are same fixed width as parent */
ul.MenuBarHorizontal ul li
{
width: 100px;
white-space: nowrap;
display: block;
float: none;
}
/* Submenus should appear slightly overlapping to the right (95%) and up (-5%) */
ul.MenuBarHorizontal ul ul
{
position: absolute;
margin: -5% 0 0 95%;
}
/* Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to 0 so it comes onto the screen */
ul.MenuBarHorizontal ul.MenuBarSubmenuVisible ul.MenuBarSubmenuVisible
{
left: auto;
top: 0;
}
/* Menu items are a light gray block with padding and no text decoration */
ul.MenuBarHorizontal a
{
display: block;
cursor: pointer;
color: #FFFFFF;
text-decoration: none;
font-family: Arial, Helvetica, sans-serif;
height: 30px;
padding-top: 10px;
font-size: 90%;
padding-right: 5px;
padding-left: 5px;
}
ul.MenuBarHorizontal /* Menu items that are open with submenus are set to MenuBarItemHover with a blue background and white text */
a.MenuBarItemHover
{
color: #FFF;
background-repeat: repeat-x;
background-image: url(../images/menu_over.gif);
}
ul.MenuBarHorizontal ul a:hover, ul.MenuBarHorizontal ul a:focus {
color: #FFF;
width: auto;
padding-right: 5px;
padding-left: 5px;
background-color: #FB2600;
}

ul.MenuBarHorizontal a.MenuBarItemSubmenuHover
{
color: #FFF;
background-image: url(../images/menu_over.gif);
}

ul.MenuBarHorizontal a.MenuBarSubmenuVisible
{
color: #FFF;
}
/************************************************** *****************************

SUBMENU INDICATION: styles if there is a submenu under a given menu item

************************************************** *****************************/

/* Menu items that have a submenu have the class designation MenuBarItemSubmenu and are set to use a background image positioned on the far left (95%) and centered vertically (50%) */
ul.MenuBarHorizontal a.MenuBarItemSubmenu
{

}
/* Menu items that have a submenu have the class designation MenuBarItemSubmenu and are set to use a background image positioned on the far left (95%) and centered vertically (50%) */
ul.MenuBarHorizontal ul a.MenuBarItemSubmenu
{
background-image: url(SpryMenuBarRight.gif);
background-repeat: no-repeat;
background-position: 95% 50%;
}
/* Menu items that are open with submenus have the class designation MenuBarItemSubmenuHover and are set to use a "hover" background image positioned on the far left (95%) and centered vertically (50%) */
ul.MenuBarHorizontal ul a.MenuBarItemSubmenuHover
{
background-color: #FB2600;

}
tacotac is offline   Reply With Quote
Old 09-27-2010, 06:37 PM   #2
DWcourse
DWcourse's Avatar
 
Join Date: Apr 2009
Posts: 3,276
Default

The problem is here:

Code:
a.MenuBarItemHover 
{
color: #FFF;
background-repeat: repeat-x;
background-image: url(../images/menu_over.gif);
}
ul.MenuBarHorizontal ul a:hover, ul.MenuBarHorizontal ul a:focus {
color: #FFF;
width: auto;
padding-right: 5px;
padding-left: 5px;
background-color: #FB2600;
}
the background-color property in ul.MenuBarHorizontal ul a:hover doesn't overwrite the background-image property in a.MenuBarItemHover

Try:

Code:
a.MenuBarItemHover 
{
color: #FFF;
background-repeat: repeat-x;
background-image: url(../images/menu_over.gif);
}
ul.MenuBarHorizontal ul a:hover, ul.MenuBarHorizontal ul a:focus {
color: #FFF;
width: auto;
padding-right: 5px;
padding-left: 5px;
background-image: none;
background-color: #FB2600;
}
__________________
If my answer helped, check out DWcourse.com for Dreamweaver tips and tutorials.
DWcourse is offline   Reply With Quote
Old 09-27-2010, 07:11 PM   #3
tacotac
 
Join Date: Sep 2010
Location: Beach Park, IL
Posts: 6
Default

WOW!! Thanks a lot!!! You are a life saver! It totally fixed it!!
tacotac is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:44 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com