Advertisement

06.15.2008 at 11:05PM PDT, ID: 23487193
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.5

Preloading of rollover images in a Dropdown menu

Asked by eastwop in Cascading Style Sheets (CSS), JavaScript, Dynamic HTML (DHTML)

I have a CSS dropdown menu that uses rollover images for the top level of navigation. The dropdown menus work fine but when the page is loading, the hover" images display on screen for a second and then the "unhovered" or default images load in their place.  The hover image is loaded into the <li> tag and the unhovered image in the <a> tag.

I would prefer to only have the "hover" images display when you mouseover them and not while the page is loading. Is there a workaround?
Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<style type="text/css">
/* ================================================================ 
This copyright notice must be kept untouched in the stylesheet at 
all times.
 
The original version of this stylesheet and the associated (x)html
is available at http://www.cssplay.co.uk/menu/pro_drop4.html
Copyright (c) 2005-2007 Stu Nicholls. All rights reserved.
This stylesheet and the associated (x)html may be modified in any 
way to fit your requirements.
=================================================================== */
 
.menu, .menu ul {list-style-type:none; padding:0; margin:0; font-family:verdana,arial, sans-serif;}
 
/* Set up the top level list items and float left to place inline */
.menu li.top {display:block; float:left; position:relative;}
 
/* Style and position the table so it takes no part in the menu function. The font size is necessary for IE5.5 */
.menu table {border-collapse:collapse; width:0; height:0; position:absolute; top:0; left:0;}
 
/* Default top link link styling */
.menu li.top a.top_link {display:block; float:left; height:36px;}
.menu li.top a span {position:absolute; left:-9999px; top:0; z-index:0; font-size:10px;} /* move the link text off screen */
 
/* pre-load the hover images into the lists */
.menu li.p1 {width:44px; background:url(images/fmenu_home2.gif) no-repeat;;}
.menu li.p2 {width:49px; background:url(images/fmenu_news2.gif) no-repeat;;}
.menu li.p3 {width:81px; background:url(images/fmenu_contact2.gif) no-repeat;;}
 
/* set up the normal unhovered images in the links */
.menu li a#home {width:44px; background:url(images/fmenu_home.gif) no-repeat;}
.menu li a#news {width:49px; background:url(images/fmenu_news.gif) no-repeat;}
.menu li a#contact {width:81px; background:url(images/fmenu_contact.gif) no-repeat;}
 
/* make the links transparent on hover so that the hover images in the lists show through (no flicker) */
.menu li a#home:hover, .menu li:hover a#home,
.menu li a#news:hover, .menu li:hover a#news,
.menu li a#contact:hover, .menu li:hover a#contact	{background:transparent;}
 
/* Style the list OR link hover. Depends on which browser is used */
.menu a:hover {visibility:visible;} /* for IE6 */
.menu li:hover { position:relative; z-index:200;} /* for IE7 */
 
/* keep the 'next' level invisible by placing it off screen. */
.menu ul, 
.menu :hover ul ul, 
.menu :hover ul :hover ul ul,
.menu :hover ul :hover ul :hover ul ul,
.menu :hover ul :hover ul :hover ul :hover ul ul {position:absolute; left:-9999px; top:-9999px; width:0; height:0; margin:0; padding:0; list-style:none;}
 
.menu :hover ul {left:0; top:36px; background: #b9d3fb; padding:0px; border:1px solid #3a93d2; border-width:0 1px 1px; white-space:nowrap; height:auto; z-index:300;}
.menu :hover ul li {display:block; height:20px; position:relative; font-weight:normal; width:auto;}
.menu :hover ul li a {display:block; font-size:11px; height:20px; line-height:20px; width:auto; padding:0 10px; color:#000; text-decoration:none;}
.menu :hover ul li a:hover {background:#3a93d2; color:#fff;}
 
.menu ul.sub1 {width:150px;}
.menu ul.sub2 {width:185px;}
 
</style>
</head>
<body>
<ul class="menu">
	<li class="top p1"><a href="#" id="home" class="top_link"><span>Home</span></a></li>
	<li class="top p2"><a href="#" id="news" class="top_link"><span>News</span><!--[if gte IE 7]><!--></a><!--<![endif]-->
		<!--[if lte IE 6]><table><tr><td><![endif]-->
		<ul class="sub1">
			<li><a href="#">First Item</a></li>
			<li><a href="#">Second Item</a></li>
		</ul>
		<!--[if lte IE 6]></td></tr></table></a><![endif]-->
	</li>
	<li class="top p3"><a href="#" id="contact" class="top_link"><span>Contact</span><!--[if gte IE 7]><!--></a><!--<![endif]-->
		<!--[if lte IE 6]><table><tr><td><![endif]-->
		<ul class="sub2">
			<li><a href="#">Item 1</a></li>
			<li><a href="#">Item2</a></li>
                   </ul>
		<!--[if lte IE 6]></td></tr></table></a><![endif]-->
	</li>
</ul>
 
Loading Advertisement...
 
[+][-]06.16.2008 at 04:14AM PDT, ID: 21792417

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Cascading Style Sheets (CSS), JavaScript, Dynamic HTML (DHTML)
Sign Up Now!
Solution Provided By: bluefezteam
Participating Experts: 1
Solution Grade: A
 
 
[+][-]06.16.2008 at 04:15AM PDT, ID: 21792425

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.21.2008 at 01:58PM PDT, ID: 21838752

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628