Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Div links not working despite being visible beside other div 2

Status
Not open for further replies.

Microbe

Programmer
Oct 16, 2000
607
AU
Hey there,

Sorry the subject was hard to phrase.

here's the situation:

I have a div with a slide out tab. When the tab sits on top of the div it works as expected.

However when I slip the tabs half behind the div with z-index the slide function breaks.

It is as though the tab div is behind another but I am pretty certain it isn't.

I have created a test page


Some things look a little weird, I stripped the page down to basics to make it easier to show you, but the effect is the same.

It loads with the tab in front. Mouseover the tab and you will see it work as expected. Then click the "swap style sheets" link and the only change is the z-index putting the tab half behind the div as I want it.

Torn a few hairs out over this so thoughts would be really appreciated. Thanks in advance

Steve
- I have fun with telemarketers
 
Default z-index of all the statically positioned elements is 0. That means that since your tab has a z-index of -1, it lies below all other elements on the page. So you might be clicking on body or any other div, but you can never really click on the link. You'll have to work with non-negative values for z-index.

___________________________________________________________
[small]Do something about world cancer today: Comprehensive cancer control information at PACT[/small]
 
Thanks for the response.

I understand what you are saying, but given that there is a background image on the body, wouldn't it then be behind the image - which it isn't.

I will play with z-index and see what I come up with.

Steve
- I have fun with telemarketers
 
Aha...I found the problem.

I had been a bit too clever for myself. The tab div was inside the wrapper div with a negative margin pushing the content out from behind.

Of course you could see the tab, but the actual div itself was behind another div which I discovered by putting a border around it.

Means a bit of a rehash of the real page but I think I will crack it now.

Thanks for the heads up, although I di know that, your answer kept me troubleshooting to discover the problem.

Steve
- I have fun with telemarketers
 
Thanks Dan,

I saw a reference to that somewhere and am making sure I don't do that. Suggestion appreciated.

Though with all the IE6 problems THAT one is minor...sigh...

Steve
- I have fun with telemarketers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top