Welcome to WebmasterWorld Guest from 54.196.231.129

Forum Moderators: not2easy

Message Too Old, No Replies

image map query

background color?

     
11:42 am on Sep 5, 2008 (gmt 0)

Junior Member

5+ Year Member

joined:July 4, 2007
posts:112
votes: 0


I'm using a gif with transparent areas; these function as the clickable areas in an image map. They work fine.

However, I'd like them to turn a color when hovered over. I've tried

.crack{
background-color:transparent}
.crack:hover{
background-color:red}
<area "class="crack" cords...

but it doesn't play. Testing in Firefox.

Any suggestions?

11:02 pm on Sept 5, 2008 (gmt 0)

Senior Member

WebmasterWorld Senior Member swa66 is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Aug 7, 2003
posts:4783
votes: 0


I'm a bit afraid it's going to be javasript that'll be the answer, but I'd love to be proven wrong.

Perhaps something we need to put on the CSS3 (or CSS4) wish list.

11:45 pm on Sept 5, 2008 (gmt 0)

Preferred Member

10+ Year Member

joined:Dec 7, 2001
posts:579
votes: 0


I also think that is JavaScript, not CSS.
12:26 am on Sept 6, 2008 (gmt 0)

Full Member

5+ Year Member

joined:July 26, 2008
posts:265
votes: 0


actually - here's a simple solution using css. It may not work for image maps (I've honestly never used them).

in your code wrap the objects of class crack in an anchor tag. For example:


<a class="hack" href="javascript:void()"><div class="crack"></div></a>

now in your css put this:


a.hack:link .crack,a.hack:visited .crack
{
background-color:transparent;
}

a.hack:hover .crack
{
background-color:red;
}

that should work! It has its limitations on what can be put inside of the anchor tag (which is why my drop-down ain't working...) but hopefully it works for you. Tell me if it does or not!
Ryan

4:40 pm on Sept 6, 2008 (gmt 0)

Junior Member

5+ Year Member

joined:July 4, 2007
posts:112
votes: 0


Ryan, thanks, nice try, no cigar.

Fixed it with images underneath the transparent areas and some script. Messy.

Cheers

1:00 am on Sept 7, 2008 (gmt 0)

Full Member

5+ Year Member

joined:July 26, 2008
posts:265
votes: 0


ya that was going to be my other suggestion, but it's definitely a messier solution. Well, glad you got it working.

Ryan