Ticket #2945 (closed bug: worksforme)
Setting "z-index: auto" in IE6 gives a type mismatch error
| Reported by: | adrian | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | 1.4.3 |
| Component: | css | Version: | 1.4.2 |
| Keywords: | ie6, z-index | Cc: | |
| Blocking: | Blocked by: |
Description
Html:
<a href="#">click me</a>
Javascript:
$('a').click(
function () {
$(this).css({'z-index':'auto'});
}
);
Onclick the javascript will try to give z-index: auto but in IE6 i receive a type mismatch error (debugger sends me to line 1120 - jquery 1.2.6)
Setting a number instead of "auto" value will work proper and no errors in IE6.
Change History
comment:2 Changed 5 years ago by Markus.Staab
oh no, because of the - you need the '. please ignore my post.
comment:3 Changed 5 years ago by flesler
- Status changed from new to closed
- Resolution set to invalid
comment:4 Changed 3 years ago by herr.schuessler
- Status changed from closed to reopened
- Resolution invalid deleted
There's also errors in IE7 and IE8 (see https://forum.jquery.com/topic/removing-reseting-z-index-with-jquery)
comment:6 Changed 3 years ago by snover
- Status changed from reopened to closed
- Resolution set to worksforme
Setting CSS values that IE does not understand no longer throws errors.
comment:7 Changed 2 years ago by jitter
- Priority changed from major to low
- Version changed from 1.2.5 to 1.4.2
- Milestone changed from 1.3 to 1.4.3
Fixed since 1.4.3 -> #5509 For a test case see http://bugs.jquery.com/ticket/6525#comment:4
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

shouldn't it be
$('a').click( function () { $(this).css({z-index:'auto'}); } );without the quotes on z-index?