2011-03-22 17:25:28 +00:00
|
|
|
(function( $ ) {
|
|
|
|
|
|
|
|
test( "offset", function() {
|
2012-06-27 15:32:48 +00:00
|
|
|
expect( 3 );
|
2011-03-22 17:25:28 +00:00
|
|
|
$( "#elx" ).position({
|
|
|
|
my: "left top",
|
|
|
|
at: "left bottom",
|
|
|
|
of: "#parentx",
|
|
|
|
offset: "10",
|
|
|
|
collision: "none"
|
|
|
|
});
|
2012-02-28 14:56:32 +00:00
|
|
|
deepEqual( $( "#elx" ).offset(), { top: 70, left: 50 }, "single value" );
|
2011-03-22 17:25:28 +00:00
|
|
|
|
|
|
|
$( "#elx" ).position({
|
|
|
|
my: "left top",
|
|
|
|
at: "left bottom",
|
|
|
|
of: "#parentx",
|
|
|
|
offset: "5 -3",
|
|
|
|
collision: "none"
|
|
|
|
});
|
2012-02-28 14:56:32 +00:00
|
|
|
deepEqual( $( "#elx" ).offset(), { top: 57, left: 45 }, "two values" );
|
2011-03-22 17:25:28 +00:00
|
|
|
|
|
|
|
$( "#elx" ).position({
|
|
|
|
my: "left top",
|
|
|
|
at: "left bottom",
|
|
|
|
of: "#parentx",
|
|
|
|
offset: "5px -3px",
|
|
|
|
collision: "none"
|
|
|
|
});
|
2012-02-28 14:56:32 +00:00
|
|
|
deepEqual( $( "#elx" ).offset(), { top: 57, left: 45 }, "with units" );
|
2011-03-22 17:25:28 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
}( jQuery ) );
|