473,387 Members | 1,790 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 8478
in post: <news:4hzsc.2007$eT4.211@attbi_s54>
Kyle James Matthews <kj*********@comcast.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="visibility: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="...">About Us</a></li>
<li><a href="...">Services</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:none"><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:none"><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
On Wed, 26 May 2004 02:41:14 GMT, e n | c k m a <bo*@marley.com> wrote:
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.


Don't be afraid. Test it in the most current Mozilla, Opera, IE and then
Lynx and maybe an old Netscape. Dive in the deep end, my friend.
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...


Functions fine in Opera 7.23, Mozilla 1.6, and IE6. I think it's rendering
fine.

Jul 20 '05 #11
> Don't be afraid. Test it in the most current Mozilla, Opera, IE and then
Lynx and maybe an old Netscape. Dive in the deep end, my friend.
Time's the enemy :)
Functions fine in Opera 7.23, Mozilla 1.6, and IE6. I think it's rendering
fine.


Thanks - I think that's because I preload it on the index.html page with a
display:none <div> (as mentioned previously).
Jul 20 '05 #12
> use a gif with the "off" part of the image transparent

maybe... I'll look into it - thanks!
Jul 20 '05 #13

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

Similar topics

1
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?...
13
by: Mr. Clean | last post by:
Can a rolloever menu be done using only CSS, without javascript?
8
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...
3
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...
5
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....
6
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...
0
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...
2
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">...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...

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.