473,609 Members | 1,900 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CSS rollover menu

Hello,

I have been lurking here for a little bit (truth be told, I lurk on too many
newsgroups to be truly effective). I have made a CSS rollover menu, and
would like some advice. The menu is at the URL
http://www.digitalovertone.com/index3.php. You will notice that the each
link disappears the first time you hover over it (this is most noticable in
Opera, in my experience). Each link consists of 2 images (1 for a:hover, 1
for a:everything else), and each image is between 500B and 2.0KB. Once the
images have been cached, this problem (obviously) disappears.

Is there any way to prevent the links from disappearing the first time while
the browser loads the :hover image? The easiest solution would of course be
to simply change the background color rather than the background image, but
this would ruin the effect of having the menu overlap the lower edge of the
picture. I would like to avoid Javascript, if possible.

I recognize the producing this effect has made for some fairly messy CSS.
That doesn't concern me at this point. I still kind of in the design phase,
and trying to get a grasp on my limitations. If there's no way to create
this effect without the link disappearing, I will seek a design solution.

Many thanks,

Kyle
Jul 20 '05 #1
12 8495
in post: <news:4hzsc.200 7$eT4.211@attbi _s54>
Kyle James Matthews <kj*********@co mcast.net> said:
Is there any way to prevent the links from disappearing the first time while
the browser loads the :hover image?


http://www.pixy.cz/blogg/clanky/cssnopreloadrollovers/
--
b r u c i e
Jul 20 '05 #2
> link disappears the first time you hover over it (this is most noticable
in
Opera, in my experience). Each link consists of 2 images (1 for a:hover, 1 for a:everything else), and each image is between 500B and 2.0KB. Once the images have been cached, this problem (obviously) disappears.


This idea might help you:

url:http://builder.com.com/5100-6371-5148960.html

alternatively, you could pre-load the images in HTML before the menu gets
downloaded:

<div style="visibili ty:hidden">
<img src="but1.gif" width="0" height="0" alt=""><img src="but2.gif"
width="0" height="0" alt=""><img src="but3.gif width="0" height="0" alt="">
</div>

<div id="menu">
<ul>
<li><a href="...">Abou t Us</a></li>
<li><a href="...">Serv ices</a></li>
</ul>

Hope that helped somehow,

Nick.
Jul 20 '05 #3
in post: <news:Br******* ********@news-server.bigpond. net.au>
e n | c k m a <bo*@marley.com > said:
<img src="but1.gif" width="0" height="0"


firewalls/filters may consider the above a webbug and kill it. for
example zonealarm considers anything below 6x1px a webbug.

--
b r u c i e
Jul 20 '05 #4
Kyle James Matthews wrote:
link disappears the first time you hover over it (this is most noticable in
Opera, in my experience). Each link consists of 2 images (1 for a:hover, 1
for a:everything else), and each image is between 500B and 2.0KB. Once the
images have been cached, this problem (obviously) disappears.

Is there any way to prevent the links from disappearing the first time while
the browser loads the :hover image?
Why use images? You can style text with css, changing it on a:hover (and
again on a:active if you like). You won't get as much control over font,
and there will be some degradation in older browsers, but the benefits
(lower page weight, easy modifications, etc.) outweigh that.
The easiest solution would of course be
to simply change the background color rather than the background image, but
this would ruin the effect of having the menu overlap the lower edge of the
picture.


I'm not sure how you're overlapping the nav onto the image. But you can
use position: relative for that. Just place the nav below the image in
the html, and use a negative value for top, e.g.:

#nav {position: relative; top: -.5em;}

--
Brian (remove "invalid" from my address to email me)
http://www.tsmchughs.com/
Jul 20 '05 #5
> firewalls/filters may consider the above a webbug and kill it. for
example zonealarm considers anything below 6x1px a webbug.


wow, i didn't know!
maybe i'll use the 'two-images-in-one' trick, too then!

thanks!
Jul 20 '05 #6
> firewalls/filters may consider the above a webbug and kill it. for
example zonealarm considers anything below 6x1px a webbug.


Actually, if I were to use display:none on the div and took the width/height
out for the image, will the image still load? I remember hearing somewhere
that display:none means that some browsers don't download the file.

Or what about:

<div style="display: block;display:n one"><img...></div>
Jul 20 '05 #7
in post: <news:sW******* *********@news-server.bigpond. net.au>
e n | c k m a <bo*@marley.com > said:
firewalls/filters may consider the above a webbug and kill it. for
example zonealarm considers anything below 6x1px a webbug.
Actually, if I were to use display:none on the div and took the width/height
out for the image, will the image still load? I remember hearing somewhere
that display:none means that some browsers don't download the file.
i remember something like that but i'm too lazy to whip up and test page
to check.
Or what about:
<div style="display: block;display:n one"><img...></div>


i think the single image repositioned is a much more elegant solution.

--
b r u c i e
Jul 20 '05 #8
> i think the single image repositioned is a much more elegant solution.

I think you're right but I'm hesitant because I haven't used
background-position before and I don't know how well supported it is...
might check w3shools.com quickly.

Actually, my issue is slightly different to the OP's... I have a link here:
url:http://144.136.41.183/pactsite/

There was an issue that the hover effect was taking a while to load but I
don't really have an "off" state as it were... the normal (unhovered) links
don't have a background. Because of this, there's no point in having one
image containing an on and off state (background-position option).

I'm trying to think of ways to _just_ preload the hover state...
Jul 20 '05 #9
in post: <news:et******* *********@news-server.bigpond. net.au>
e n | c k m a <bo*@marley.com > said:
url:http://144.136.41.183/pactsite/
There was an issue that the hover effect was taking a while to load but I
don't really have an "off" state as it were... the normal (unhovered) links
don't have a background.


use a gif with the "off" part of the image transparent
--
b r u c i e
Jul 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4648
by: DJ | last post by:
I've got a rollover-popup menu which pops below the viewable area of my top frame. I don't want to resize the frame. Any way I can pop over the frame? Or make the pop-down background solid? Or pop side-ways? or pop upwards? Any suggestions welcome. Please respond to list, email isn't working.
13
4927
by: Mr. Clean | last post by:
Can a rolloever menu be done using only CSS, without javascript?
8
2213
by: Mr. Clean | last post by:
I have two images in a rollover: http://www.austinmetrobaseball.com/images/austindivmenu_red.gif and http://www.austinmetrobaseball.com/images/austindivmenu_blue.gif I'd like to be able to do that type of rollover with CSS only. I'm pretty sure it can be done with two spans in the li but can't get anything to work.
3
3785
by: Alex | last post by:
I created a page ( http://www.ayida.net/benaglia/chi.html ) based on the example B of the fixed-width layout i found here: http://builder.com.com/5100-6371-5314471-2.html the layout needs this doctype to work properly both on IE and Firefox: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> otherwise on IE it won't center the layout on the page. unfortunatly the above mentioned...
5
4176
by: Bribro | last post by:
I have an horizontal menu with a dreamweaver-generated rollover effect. Images are png and their transparency is handled by pngfix.js In IE, applied the pngfix, the rollover doesn't work at all. Obviously, if I cut the pngfix the rollover works fine but the transparency of images is gone. Can anybody help me? Thanks.
6
3179
by: AJBopp | last post by:
I'm wrestling with CSS variations between Firefox and IE. I'm trying to create rollover buttons in a menu frame. It is working perfectly in Firefox but in IE only the first button is properly highlighted and linked. The second button, has only a partial "hit area" at the top of the image, although if you click the link, you can see the link border is properly place around the image. The rest of the buttons have no rolloever state or link...
0
1248
by: nospam | last post by:
Hi everybody, the attached portion of code generates a classic rollover menu through CSS. The menu works normally. I'd like to display a small 8x8 pixels icon nearby some menu items, basically those referring to external links. On Firefox and Konqueror everything works perfectly. On IE (6, at the least) however, the menu options with the icon are displayed with a "wrong" height. I can't explain it better than this, just try the following
2
4174
by: dharmbhav | last post by:
Hello all, I am trying to develop a roll-over menu effect on a page. It works fine with all other browsers except IE6. Can some one please help me? HTML: <div class="menu-item-wrap"> <a href="#" class="menu-item-text"> Menu1 </a>
0
8129
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8074
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8571
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8535
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8220
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5509
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4080
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2530
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1386
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.