Tuesday, March 30, 2010

Menu buttons briefly turn white when...

When I hover over a menu button it turns white in IE and transparent in FF for about 2 seconds then displays the correct hover image. This happens the first time you hover, then it behaves normally after that.

Take a look here http://www.preferreddigitalprints.com/

I think I have something messed up in the CSS but can figure out what it is. I'm hoping someone has seen this before and would be kind enough to point me in the right direction.

Here's my CSS:

@charset ''UTF-8'';

/* SpryMenuBarHorizontal.css - Revision: Spry Preview Release 1.4 */

/* Copyright (c) 2006. Adobe Systems Incorporated. All rights reserved. */

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

LAYOUT INFORMATION: describes box model, positioning, z-order

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

/* the outer table */

table#menu img {float:left; width: 39px;}

/* The outermost container of the Menu Bar, an auto width box with no margin or padding */

ul.MenuBarHorizontal

{

margin: 0;

padding: 0;

list-style-type: none;

font-size: 100%;

cursor: default;

width: 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

{

margin: 0;

padding: 0;

list-style-type: none;

font-size: 100%;

position: relative;

text-align: left;

cursor: pointer;

float: left;

width: auto;

}

ul.MenuBarHorizontal li #home {width: 132px; margin-left: -5px;}

ul.MenuBarHorizontal li #services {width: 155px;}

ul.MenuBarHorizontal li #order {width: 176px; }

ul.MenuBarHorizontal li #webaccess {width: 174px;}

ul.MenuBarHorizontal li #contact {width: 160px; margin-right:-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: 0;

padding: 0;

list-style-type: none;

font-size: 100%;

z-index: 1020;

cursor: default;

width: 13em;

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;

}

/* Menu item containers are same fixed width as parent */

ul.MenuBarHorizontal ul li

{

width: 13em;

}

ul.MenuBarHorizontal ul li a

{ background-color: #1a542c; color:#FFFFFF; padding: 6px; }

ul.MenuBarHorizontal ul li a:hover

{ background-color: #73152e; color:#FFFFFF; padding: 6px;}

/* Submenus should appear slightly overlapping to the right (95%) and up (-5%) */

ul.MenuBarHorizontal ul ul

{

position: absolute;

margin: 0% 0 0 100%;

}

/* 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;

}

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

DESIGN INFORMATION: describes color scheme, borders, fonts

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

/* Submenu containers have borders on all sides */

ul.MenuBarHorizontal ul

{ font-family:Arial, Helvetica, sans-serif; font-size: 12px;}

/* Menu items */

ul.MenuBarHorizontal a

{

display: block;

cursor: pointer;

height: 32px;

text-decoration: none; }

ul.MenuBarHorizontal a#home { background-image: url(../BTNHomeUP.png);}

ul.MenuBarHorizontal a#services { background-image: url(../BTNServicesUP.png);}

ul.MenuBarHorizontal a#order { background-image: url(../BTNOrderUP.png);}

ul.MenuBarHorizontal a#webaccess { background-image: url(../BTNWebAccessUP.png);}

ul.MenuBarHorizontal a#contact { background-image: url(../BTNContactUsUP.png);}

/* Menu items that have mouse over */

ul.MenuBarHorizontal a#home:hover { background-image: url(../BTNHomeOVER.png);}

ul.MenuBarHorizontal a#services:hover { background-image: url(../BTNServicesOVER.png);}

ul.MenuBarHorizontal a#order:hover { background-image: url(../BTNOrderOVER.png);}

ul.MenuBarHorizontal a#webaccess:hover { background-image: url(../BTNWebAccessOVER.png);}

ul.MenuBarHorizontal a#contact:hover { background-image: url(../BTNContactUsOVER.png);}

/* ul.MenuBarHorizontal a:hover, ul.MenuBarHorizontal a:focus */

/* Menu items that are open with submenus are set to MenuBarItemHover with a blue background and white text

ul.MenuBarHorizontal a.MenuBarItemHover, ul.MenuBarHorizontal a.MenuBarItemSubmenuHover, ul.MenuBarHorizontal a.MenuBarSubmenuVisible

{

background-color: #33C;

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

{

background-image: url(SpryMenuBarDown.gif);

background-repeat: no-repeat;

background-position: 95% 50%;

}

/* 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 a.MenuBarItemSubmenuHover

{

background-image: url(SpryMenuBarDownHover.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-image: url(SpryMenuBarRightHover.gif);

background-repeat: no-repeat;

background-position: 95% 50%;

}

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

BROWSER HACKS: the hacks below should not be changed unless you are an expert

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

/* HACK FOR IE: to make sure the sub menus show above form controls, we underlay each submenu with an iframe */

ul.MenuBarHorizontal iframe

{

position: absolute;

z-index: 1010;

}

/* HACK FOR IE: to stabilize appearance of menu items; the slash in float is to keep IE 5.0 from parsing */

@media screen, projection

{

ul.MenuBarHorizontal li.MenuBarItemIE

{

display: inline;

f\loat: left;

background: #FFF;

}

}

Menu buttons briefly turn white when...

Putting your page through the html validator bought up a few errors

http://validator.w3.org/check?verbose=1%26amp;uri=http%3A%2F%2Fwww.preferreddigitalpri nts.com%2F

The most important error is that the page isn't using a doctype.?This could account for the bugginess of the page.?A page without a doctype will render CSS in quirks mode and not display the page as intended in some browsers.

Please insert a doctype at the top of the document, then put the page through the validator again to see what errors remain, fix those, and hopefully the page will load OK.?I didn't look at the navbar images, but make sure that they are optimized for the web, because that can also cause a slow down on loading them.

I recommend using the transitional doctype.

DOCTYPES:

Reference:?

http://www.alistapart.com/articles/doctype/

http://htmlhelp.com/tools/validator/doctype.html

:

Menu buttons briefly turn white when...

Nadia,

I added the doctype and I'll work on correcting those errors shown in the html validator. However I think what you said about the button images possibly needing to be web optimized might indeed be the problem. When you hover over a button for the first time, it takes 1-2 seconds for the hover image to load, then once the image has loaded you can hover again and it displays immediatly. The images are 7-10 kb each. Does that seem too large to be web optimized?

I can see you're very generous with your time helping so many people here and I thank you kindly for your response!

The images are 7-10 kb each. Does that seem too large to be web optimized?

No comments:

Post a Comment