mirror of
https://github.com/jquery/jquery.git
synced 2026-02-08 10:35:11 -05:00
Use parseFloat instead of parseInt to read CSS values.
This fixes #7730 and #7885.
This commit is contained in:
@@ -187,11 +187,13 @@ jQuery.offset = {
|
||||
// need to be able to calculate position if either top or left is auto and position is absolute
|
||||
if ( calculatePosition ) {
|
||||
curPosition = curElem.position();
|
||||
curTop = curPosition.top;
|
||||
curLeft = curPosition.left;
|
||||
} else {
|
||||
curTop = parseFloat( curCSSTop ) || 0;
|
||||
curLeft = parseFloat( curCSSLeft ) || 0;
|
||||
}
|
||||
|
||||
curTop = calculatePosition ? curPosition.top : parseInt( curCSSTop, 10 ) || 0;
|
||||
curLeft = calculatePosition ? curPosition.left : parseInt( curCSSLeft, 10 ) || 0;
|
||||
|
||||
if ( jQuery.isFunction( options ) ) {
|
||||
options = options.call( elem, i, curOffset );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user