Opened 14 years ago
Closed 14 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)
Change History (9)
comment:1 Changed 14 years ago by
comment:2 Changed 14 years ago by
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 14 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
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 14 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
It's not fixed Brandon, just invalid.
comment:6 Changed 14 years ago by
Resolution: | → invalid |
---|---|
Status: | reopened → closed |
comment:7 Changed 14 years ago by
Resolution: | invalid |
---|---|
Status: | closed → reopened |
Awww... skipped the last line. I'm really really sorry.
comment:8 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
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