aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/position/position_deprecated.js
blob: 9a3164246cd2166e8513b78b6f8d947b6aa623b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
(function( $ ) {

test( "offset", function() {
	$( "#elx" ).position({
		my: "left top",
		at: "left bottom",
		of: "#parentx",
		offset: "10",
		collision: "none"
	});
	deepEqual( $( "#elx" ).offset(), { top: 70, left: 50 }, "single value" );

	$( "#elx" ).position({
		my: "left top",
		at: "left bottom",
		of: "#parentx",
		offset: "5 -3",
		collision: "none"
	});
	deepEqual( $( "#elx" ).offset(), { top: 57, left: 45 }, "two values" );

	$( "#elx" ).position({
		my: "left top",
		at: "left bottom",
		of: "#parentx",
		offset: "5px -3px",
		collision: "none"
	});
	deepEqual( $( "#elx" ).offset(), { top: 57, left: 45 }, "with units" );
});

}( jQuery ) );