mirror of
https://github.com/jquery/jquery.git
synced 2025-01-10 18:24:24 +00:00
Offset: Send px-ed strings to .css()
An upcoming release of Migrate will generate warnings for calls to .css() that pass numbers rather than strings, see jquery/jquery-migrate#296 . At the moment, core's .offset() setter passes numbers rather than px strings so it would throw warnings. This commit fixes that. Closes gh-4508
This commit is contained in:
parent
6d31477a35
commit
57038faebc
@ -63,6 +63,12 @@ jQuery.offset = {
|
||||
options.using.call( elem, props );
|
||||
|
||||
} else {
|
||||
if ( typeof props.top === "number" ) {
|
||||
props.top += "px";
|
||||
}
|
||||
if ( typeof props.left === "number" ) {
|
||||
props.left += "px";
|
||||
}
|
||||
curElem.css( props );
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user