Bug Tracker

Opened 11 years ago

Closed 11 years ago

#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:
Blocked by: Blocking:

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 (1)

index.htm (1.0 KB) - added by TNT 11 years ago.
test html file

Download all attachments as: .zip

Change History (9)

comment:1 Changed 11 years ago by TNT

actualy i try this:

nDiv=$('#div3').clone();

$(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

comment:2 Changed 11 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)

Changed 11 years ago by TNT

Attachment: index.htm added

test html file

comment:3 Changed 11 years ago by TNT

I'm added test html attachment file

comment:4 Changed 11 years ago by brandon

Resolution: fixed
Status: newclosed

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 11 years ago by flesler

Resolution: fixed
Status: closedreopened

It's not fixed Brandon, just invalid.

comment:6 Changed 11 years ago by flesler

Resolution: invalid
Status: reopenedclosed

comment:7 Changed 11 years ago by flesler

Resolution: invalid
Status: closedreopened

Awww... skipped the last line. I'm really really sorry.

comment:8 Changed 11 years ago by flesler

Resolution: fixed
Status: reopenedclosed
Note: See TracTickets for help on using tickets.