Skip to content

Commit 116fe6a

Browse files
committed
2 parents 225a8fa + 24e8c44 commit 116fe6a

File tree

2 files changed

+26
-9
lines changed

2 files changed

+26
-9
lines changed

jquery/jquery-tests.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1802,16 +1802,22 @@ function test_innerWidth() {
18021802

18031803
function test_outerHeight() {
18041804
var p = $("p:first");
1805-
$("p:last").text("outerHeight:" + p.outerHeight(true));
1806-
p.outerHeight(p.outerHeight() * 2).outerHeight();
1807-
p.outerHeight(p.outerHeight() * 2, true).outerHeight();
1805+
$("p:last").text(
1806+
"outerHeight:" + p.outerHeight() +
1807+
" , outerHeight( true ):" + p.outerHeight(true));
18081808
}
18091809

18101810
function test_outerWidth() {
18111811
var p = $("p:first");
1812-
$("p:last").text("outerWidth:" + p.outerWidth(true));
1813-
p.outerWidth(p.outerWidth() * 2).outerWidth();
1814-
p.outerWidth(p.outerWidth() * 2, true).outerWidth();
1812+
$("p:last").text(
1813+
"outerWidth:" + p.outerWidth() +
1814+
" , outerWidth( true ):" + p.outerWidth(true));
1815+
}
1816+
1817+
function test_position() {
1818+
var p = $("p:first");
1819+
var position = p.position();
1820+
$("p:last").text("left: " + position.left + ", top: " + position.top);
18151821
}
18161822

18171823
function test_insertAfter() {

jquery/jquery.d.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,13 +1048,24 @@ interface JQuery {
10481048
*/
10491049
offset(func: (index: number, coords: JQueryCoordinates) => JQueryCoordinates): JQuery;
10501050

1051+
/**
1052+
* Get the current computed height for the first element in the set of matched elements, including padding, border, and optionally margin. Returns an integer (without "px") representation of the value or null if called on an empty set of elements.
1053+
*
1054+
* @param includeMargin A Boolean indicating whether to include the element's margin in the calculation.
1055+
*/
10511056
outerHeight(includeMargin?: boolean): number;
1052-
outerHeight(value: number, includeMargin?: boolean): JQuery;
10531057

1058+
/**
1059+
* Get the current computed width for the first element in the set of matched elements, including padding and border.
1060+
*
1061+
* @param includeMargin A Boolean indicating whether to include the element's margin in the calculation.
1062+
*/
10541063
outerWidth(includeMargin?: boolean): number;
1055-
outerWidth(value: number, includeMargin?: boolean): JQuery;
10561064

1057-
position(): { top: number; left: number; };
1065+
/**
1066+
* Get the current coordinates of the first element in the set of matched elements, relative to the offset parent.
1067+
*/
1068+
position(): JQueryCoordinates;
10581069

10591070
scrollLeft(): number;
10601071
scrollLeft(value: number): JQuery;

0 commit comments

Comments
 (0)