Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
z-index trouble in IE with interactive CSS map
Old 10-13-2011, 01:57 PM z-index trouble in IE with interactive CSS map
pealo86's Avatar
Super Spam Talker

Posts: 876
Name: Matt Pealing
Location: England, north west
Trades: 0
I've made a basic interactive CSS / jQuery map of the UK in which each country is highlight as you hover over it.

Here is a link to it:
http://tinyurl.com/3u9gnw6

I have highlighted each country with a red border so that you can see the dimensions of each image.

Of course, it works fine in all browsers bar IE, although I'm a little surprised to see that it doesn't even work in IE9.

It seems as though IE just isn't reading the z-index properties properly. It's like you have to hover completely out of the map and then carefully hover over your country of choice, without touching any of the others.

It's quite hard to explain my problem but you'll see what I mean if you try it.

Here is my CSS for the associated element(s):

Code:
#map-uk {
    position: relative;
    height: 316px;
    z-index: 1000;
}

#map-uk .map {
    position: absolute;
    top: 15px;
    left: 35px;
    z-index: 0;
}

#map-uk a {
    position: absolute;
    border: red solid 1px;
}

#map-uk a img {
    display: none;
}

#map-uk #map-uk-hover-scotland {
    width: 107px;
    height: 142px;
    right: 71px;
    top: 14px;
    z-index: 2;
}

#map-uk #map-uk-hover-england {
    width: 143px;
    height: 184px;
    bottom: 5px;
    right: 4px;
    z-index: 1;
}

#map-uk #map-uk-hover-wales {
    bottom: 49px;
    right: 87px;
    width: 55px;
    height: 68px;
    z-index: 4;
}

#map-uk #map-uk-hover-ireland {
    width: 54px;
    height: 50px;
    left: 80px;
    top: 135px;
    z-index: 3;
}
Does anyone know what might be missing / incorrect to prevent it working in IE? I know about the z-index bug (which I think I've fixed with the 'z-index: 10' property on #map-uk. But I'm still getting the issue mentioned above.
__________________

Please login or register to view this content. Registration is FREE
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
 
Register now for full access!
Old 10-13-2011, 03:01 PM Re: z-index trouble in IE with interactive CSS map
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
IE has ALWAYS had "issues" with abslute positioning and stacking,

Why not use relative positioning with stacking orders instead?
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-13-2011, 03:07 PM Re: z-index trouble in IE with interactive CSS map
pealo86's Avatar
Super Spam Talker

Posts: 876
Name: Matt Pealing
Location: England, north west
Trades: 0
Hmmm I hadn't thought of using relative positioning! I assumed that could be a little tricky as relative positioning wouldn't take them out of the flow?
__________________

Please login or register to view this content. Registration is FREE
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
Old 10-13-2011, 03:46 PM Re: z-index trouble in IE with interactive CSS map
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
It's being "out of the flow" that IE has problems with.

Provided you know how to restore the flow back to it's original point it isn't really a problem.

http://www.modtalk.co.uk/_site/code/...ning/relative/
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-13-2011, 04:16 PM Re: z-index trouble in IE with interactive CSS map
pealo86's Avatar
Super Spam Talker

Posts: 876
Name: Matt Pealing
Location: England, north west
Trades: 0
Ah cool I'll check it out thanks
__________________

Please login or register to view this content. Registration is FREE
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
Old 10-16-2011, 07:16 AM Re: z-index trouble in IE with interactive CSS map
pealo86's Avatar
Super Spam Talker

Posts: 876
Name: Matt Pealing
Location: England, north west
Trades: 0
Hmmm I've tried it with relative positioning too but I seemed to have the same problem with regards to hovering over the <a> tags?

One thing I've just stumbled across whilst testing it, I decided to add a background colour to each <a> so that I could see if they were stacked in the correct order in IE.

And now I've found that the hover's work perfectly in IE when a background colour is applied?!

See here:
http://tinyurl.com/3cm9mvk

Then compare to the original (with red borders to outline the <a> tags):
http://tinyurl.com/3ezkow8

Even in IE7, the map works fine when background colours are applied. The problem might be due to the fact that I'm using transparent .png's?

Does anyone know of a workaround? As me slicing up the map and applying a separate background to each individual <a> tag isn't an idea solution, although it may be the only one!
__________________

Please login or register to view this content. Registration is FREE
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
Old 10-16-2011, 07:35 AM Re: z-index trouble in IE with interactive CSS map
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Sounds like a "haslayout" problem in that case.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-16-2011, 09:15 AM Re: z-index trouble in IE with interactive CSS map
pealo86's Avatar
Super Spam Talker

Posts: 876
Name: Matt Pealing
Location: England, north west
Trades: 0
You think so? It states in the article that the elements can be given a layout by specifying a height or width, or positioning absolutely... but my elements have all of those specified!

Perhaps it's due to it being a HTML5 document? Maybe IE is struggling with it?
__________________

Please login or register to view this content. Registration is FREE
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
Old 10-16-2011, 09:34 AM Re: z-index trouble in IE with interactive CSS map
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
You think so? It states in the article that the elements can be given a layout by specifying a height or width, or positioning absolutely..
True but it is Infernet Exploder and it's not unknown for bug fix 'A' to expose or introduce bug ref No. 9,023,189.117.003

IE9 is supposed to be at least HTML5 tolerant but it could be worth trying a different DTD if you have no specific HTML5 requirements.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-20-2011, 03:11 AM Re: z-index trouble in IE with interactive CSS map
Novice Talker

Posts: 10
Name: Umar Bukhari
Location: Pakistan
Trades: 0
Here is a best example of maps for you. You must get idea from this example.

173.236.39.250/~angelsde/homesafari/
angelsdev is offline
Reply With Quote
View Public Profile Visit angelsdev's homepage!
 
Old 10-21-2011, 08:23 AM Re: z-index trouble in IE with interactive CSS map
pealo86's Avatar
Super Spam Talker

Posts: 876
Name: Matt Pealing
Location: England, north west
Trades: 0
Quote:
Originally Posted by chrishirst View Post
True but it is Infernet Exploder and it's not unknown for bug fix 'A' to expose or introduce bug ref No. 9,023,189.117.003

IE9 is supposed to be at least HTML5 tolerant but it could be worth trying a different DTD if you have no specific HTML5 requirements.
Tried some of the other properties (e.g. 'inline-block') AND tried as XHTML Strict instead of HTML5... and STILL no luck!

I don't think I've ever hated IE so much


Quote:
Originally Posted by angelsdev View Post
Here is a best example of maps for you. You must get idea from this example.

173.236.39.250/~angelsde/homesafari/

I was hoping to avoid image maps and stick with a CSS map, but it's looking as though it's the only way to go.

I can't seem to style the <area> elements though
__________________

Please login or register to view this content. Registration is FREE
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
Old 10-24-2011, 11:17 AM Re: z-index trouble in IE with interactive CSS map
pealo86's Avatar
Super Spam Talker

Posts: 876
Name: Matt Pealing
Location: England, north west
Trades: 0
Managed to find a solution in the end, simply apply a transparent GIF to the <a> tags for IE:

Code:
#map-uk a {
    position: absolute;
    background: url('../image/ie-fix.gif');
}
A little dirty, but if I spent any longer trying other ways to get it to work in IE I'd have ended up ripping all my hair out.
__________________

Please login or register to view this content. Registration is FREE
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
Reply     « Reply to z-index trouble in IE with interactive CSS map
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.18141 seconds with 12 queries