Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery positioning differences between Chrome(webkit) and Firefox

While working on a jQuery UI range slider, I was mainly debugging in chrome. I needed to make the range have a limit so I would grab the left position of one of the handles like so:

$el.css('left');

Which would give me the left position as a percentage: 84%. However, when I tested in Firefox, it was returning the value in pixels.

Has anyone experienced this before? Based on looking at the DOM in Firebug, Firefox does recognize percent-based left positioning but it doesn't seem to return that as a value. Is this default behavior for Firefox? Is this the same in IE as well?

like image 583
hellatan Avatar asked Jan 10 '11 04:01

hellatan


1 Answers

use $el.position().left; instead :)

like image 142
shahidaltaf Avatar answered Oct 22 '22 05:10

shahidaltaf