Ticket #3584 (closed bug: fixed)
css('top',0) causes incorrect positioning in IE6
| Reported by: | TNT | Owned by: | brandon |
|---|---|---|---|
| Priority: | major | Milestone: | 1.3 |
| Component: | offset | Version: | 1.2.6 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
try this code:
$('#div4').css({
'border':'1px solid red', 'position':'absolute', 'top':'0'
});
then i try: offs4=$('#div4').offset(); alert(offs4.top); -> this show me 2 not 0
Attachments
Change History
comment:2 Changed 5 years ago by flesler
Indeed, you need to use '0px' or 0. I really can't tell about the second issue.
Can you make a test case ? (html file please)
comment:4 Changed 5 years ago by brandon
- Status changed from new to closed
- Resolution set to fixed
The core of your issue is that you are in QuriksMode because you do not have a valid DocType. You can fix this by either using a valid DocType or by setting html { border: 0; } in your css.
This is now fixed in rev 5942.
comment:5 Changed 5 years ago by flesler
- Status changed from closed to reopened
- Resolution fixed deleted
It's not fixed Brandon, just invalid.
comment:6 Changed 5 years ago by flesler
- Status changed from reopened to closed
- Resolution set to invalid
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.


actualy i try this:
$(nDiv).appendTo(document.body);
$(nDiv).attr("id","div4");
$(nDiv).css({'width': 10, 'height': 10, 'border': '1px solid red', 'position': 'absolute', 'top': '0px', 'left': '0px'});
offs4=$('#div4').offset();
alert(offs4.top);
-> the DIV is corectly positioned but this show me 2 instead of 0 in IE6,in FF show me correct value of 0