Bug Tracker

Opened 10 years ago

Closed 10 years ago

#12352 closed bug (duplicate)

$.fn.css() return values don't match across browsers

Reported by: avaly2 Owned by:
Priority: low Milestone: 1.next
Component: offset Version: 1.8.0
Keywords: Cc:
Blocked by: Blocking:


jQuery version: 1.8.0

Browsers: Chrome 21.0.1180.79, Firefox 14.0.1

OS: Windows 7

Steps to reproduce:

  1. Create an absolute positioned element with the left property set to a percentage value (L) and a transform property set to translate or translate3d with any value for the x-axis defined (X)
  2. Query jQuery for the left property: jQuery(element).css('left')

Expected values:

  • Value equal to L (either in percentage or converted to pixels)

Actual values:

  • Chrome 21 reports L + X

Value is returned by .offset() which is used in webkit.

  • Firefox 14 reports L

Test case: http://jsfiddle.net/avaly/MFtDr/10/

Change History (3)

comment:1 Changed 10 years ago by avaly2

Test case from description uses translate3d.

Test case with translate: http://jsfiddle.net/avaly/MFtDr/11/

comment:2 Changed 10 years ago by mikesherov

Component: unfiledoffset
Milestone: None1.next
Priority: undecidedlow
Status: newopen

This is because jQuery doesn't take into account translation for its offset methods.

comment:3 Changed 10 years ago by dmethvin

Resolution: duplicate
Status: openclosed

Duplicate of #8362.
If the discussion in #8362 is correct, there is a large amount of code needed to normalize this. See the discussion there.

Note: See TracTickets for help on using tickets.