});
test( "using", function() {
- expect( 6 );
+ expect( 10 );
var count = 0,
elems = $( "#el1, #el2" ),
- expectedPosition = { top: 40, left: 40 },
+ of = $( "#parentx" ),
+ expectedPosition = { top: 60, left: 60 },
+ expectedFeedback = {
+ target: {
+ element: of,
+ width: 20,
+ height: 20,
+ left: 40,
+ top: 40
+ },
+ element: {
+ width: 6,
+ height: 6,
+ left: 60,
+ top: 60
+ },
+ horizontal: "left",
+ vertical: "top",
+ important: "vertical"
+ },
originalPosition = elems.position({
my: "right bottom",
at: "rigt bottom",
elems.position({
my: "left top",
- at: "left top",
+ at: "center+10 bottom",
of: "#parentx",
- using: function( position ) {
+ using: function( position, feedback ) {
deepEqual( this, elems[ count ], "correct context for call #" + count );
deepEqual( position, expectedPosition, "correct position for call #" + count );
+ deepEqual( feedback.element.element[ 0 ], elems[ count ] );
+ delete feedback.element.element;
+ deepEqual( feedback, expectedFeedback );
count++;
}
});