473,386 Members | 1,699 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,386 software developers and data experts.

css - hover over change background of entire map

Hi there,

I've got a gif with (highly) irregular shapes (lots of jigsaw pieces)
that I want to map so that each piece is a link...
The pieces are currently just a frame drawing, but as they are hovered
over I want them to be coloured in. I thought the easiest way to do
this would be to change the background image of the entire map (since
it's a bit of a pain trying to select each piece out of the image and
colour them seperately...), with a seperate image showing one of the
pieces coloured in at a time. Is this possible?
Basically, I want to know if it's possible to have a hover over a link
change the background of the entire map and not just that link...
The css (largely pilfered from Frank Manno's site - cheers :) ) is
currently as follows:
***
dl#jigsaw{
margin: 0;
padding: 0;
background: url('images/jig_frame_small.gif') no-repeat top
left;
height: 105px;
width: 354px;
position: relative

}
dt{ margin: 0; padding: 0; position: absolute; font-size: 85%; display:

none; }
dd{ margin: 0; padding: 0; position: absolute; font-size: 85%; }

dd#cms{ top: 0px; left: 0px; }
dd#cms a{ position: absolute; width: 73px; height: 69px;
text-decoration: none; background-color:red;}
dd#cms a:hover{ position: absolute; background:
url('images/jig_frame_small.gif') no-repeat top left;) }
***
This cms a:hover doesn't do anything!
the html looks like this:
***
<dl id="jigsaw">
<dt id="cms">1. Monitor</dt>
<dd id="cms"><a href="index.htm"></a></dd>
</dl>
***
Many thanks,
Chris

Feb 14 '06 #1
2 4518
Els
ch**********@yahoo.com wrote:
Hi there,

I've got a gif with (highly) irregular shapes (lots of jigsaw pieces)
that I want to map so that each piece is a link...

The pieces are currently just a frame drawing, but as they are hovered
over I want them to be coloured in. I thought the easiest way to do
this would be to change the background image of the entire map (since
it's a bit of a pain trying to select each piece out of the image and
colour them seperately...), with a seperate image showing one of the
pieces coloured in at a time. Is this possible?

Basically, I want to know if it's possible to have a hover over a link
change the background of the entire map and not just that link...
Only if that entire map would really be contained within that link.
Could work with spans and absolute positioning, relative to the links
themselves which also would be have position:absolute;.
The css (largely pilfered from Frank Manno's site - cheers :) ) is
currently as follows:

***
dl#jigsaw{
margin: 0;
padding: 0;
background: url('images/jig_frame_small.gif') no-repeat top
left;
height: 105px;
width: 354px;
position: relative

}

dt{ margin: 0; padding: 0; position: absolute; font-size: 85%; display:

none; }
dd{ margin: 0; padding: 0; position: absolute; font-size: 85%; }

dd#cms{ top: 0px; left: 0px; }

dd#cms a{ position: absolute; width: 73px; height: 69px;
text-decoration: none; background-color:red;}

dd#cms a:hover{ position: absolute; background:
url('images/jig_frame_small.gif') no-repeat top left;) }
***

This cms a:hover doesn't do anything!

the html looks like this:

***
<dl id="jigsaw">
<dt id="cms">1. Monitor</dt>
<dd id="cms"><a href="index.htm"></a></dd>
</dl>
***


I'm not seeing how the above would be working for what you want, but
apart from that, you can't use an id twice in one page.
Try replacing the <dd id="cms"> with <dd id="cms2"> and change the
styles accordingly to see if that helps.

But hovering over the <a> in the <dd> will not cause the background
image to appear anywhere else than right there where you are hovering.

To make that happen, you'd need to add a <span> inside the <a>
element, and give that span a height, width, display:block, and
position (absolute, but relative to the link itself) and a background
image.

Problem with that is though, that this background image would cover
all the links that are earlier in the code, and be covered by all the
links later in the code. Or at least in one or two browsers that would
be the case, forgot which one(s).

--
Els http://locusmeus.com/
accessible web design: http://locusoptimus.com/

Now playing: Electric Boys - Mary In The Mystery World
Feb 14 '06 #2
Yes - you're entirely right, the span does cover up other links..
hadn't thought of that...

Just changing the background for each link would be better - will have
to dig out some better image manipulation kit other than paint I guess
....

Many thanks

Chris

Feb 14 '06 #3

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

Similar topics

2
by: Sugapablo | last post by:
Can anyone help me out with some code to change three table cells (<td>) when one is hovered over? I have a calendar grid where each day is made up of three table cells and I want all three to...
51
by: madsgormlarsen | last post by:
I can not get hover effect on a TD to work in IE, it seams you can not have a hover on a td in IE? I have treid this body.section-2 td.current, body.section-2 td.submenu, body.section-2...
13
by: Gary | last post by:
I have a table with a form consisting of several checkboxes and I'm wondering if its possible to change the table row background color on mouseover or hover and make it stay that color when the...
24
by: fehays | last post by:
Hello, I'm having a problem with the css hover effect in IE. I have an <a> tag with the following CSS: a.subNavItem { display:block; color:#464645; padding:2px 7px 4px 6px;...
2
by: andrewtayloruk | last post by:
Hi, i'm pretty new to CSS and html so please go easy on me. I'm trying to make a menu, the idea is that when you hover over the images in the menu they glow. To do this i have set up the...
3
by: mfc1981 | last post by:
Hi. I need to access to the hover style of an element with javascript. How can i do this? Best regards Manuel
1
by: darkzone | last post by:
Hi I saw this layout and wanted to try some thing similar, but I am unable to change the position of the vertical menu with out changing the position of the hole document and I don't really have a...
4
by: Sigilaea | last post by:
My previous post got squashed because m post is too long. Sorry for that: I have an AJAX page with a CSS menu at the top. My problem is the hover functionality stops working after someone clicks...
1
by: rupak | last post by:
I have an mouseover effect with css on hover, which change the image on hover through Css. It works with IE fine but have problem with Mozilla, as the background image not coming full on hover. If...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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:
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,...
0
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...

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.