Skip to main content

Bug Tracker

Side navigation

#3584 closed bug (fixed)

Opened November 08, 2008 03:22PM UTC

Closed November 13, 2008 02:41AM UTC

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 November 10, 2008 08:05PM UTC.

    test html file

Change History (8)

Changed November 09, 2008 08:27PM UTC by TNT comment:1

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

Changed November 10, 2008 02:39PM UTC by flesler comment:2

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 November 10, 2008 08:06PM UTC by TNT comment:3

I'm added test html attachment file

Changed November 13, 2008 02:36AM UTC by brandon comment:4

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.

Changed November 13, 2008 02:40AM UTC by flesler comment:5

resolution: fixed
status: closedreopened

It's not fixed Brandon, just invalid.

Changed November 13, 2008 02:40AM UTC by flesler comment:6

resolution: → invalid
status: reopenedclosed

Changed November 13, 2008 02:41AM UTC by flesler comment:7

resolution: invalid
status: closedreopened

Awww... skipped the last line.

I'm really really sorry.

Changed November 13, 2008 02:41AM UTC by flesler comment:8

resolution: → fixed
status: reopenedclosed