Skip to main content

Bug Tracker

Side navigation

#12352 closed bug (duplicate)

Opened August 20, 2012 02:22PM UTC

Closed August 20, 2012 06:00PM UTC

$.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:
Description

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/

Attachments (0)
Change History (3)

Changed August 20, 2012 02:24PM UTC by avaly2 comment:1

Test case from description uses translate3d.

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

Changed August 20, 2012 05:53PM UTC by mikesherov comment:2

component: unfiledoffset
milestone: None1.next
priority: undecidedlow
status: newopen

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

Changed August 20, 2012 06:00PM UTC by dmethvin comment:3

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.