mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Offset: offsetLeft/Top on empty set returns undefined
Fixes gh-2319 Closes gh-2702 Ref gh-2701
This commit is contained in:
parent
97d79ecf6b
commit
2937019060
@ -202,7 +202,7 @@ jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function(
|
|||||||
} else {
|
} else {
|
||||||
elem[ method ] = val;
|
elem[ method ] = val;
|
||||||
}
|
}
|
||||||
}, method, val, arguments.length, null );
|
}, method, val, arguments.length );
|
||||||
};
|
};
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
@ -460,8 +460,8 @@ testIframe( "offset/scroll", "scroll", function( $, win, doc, assert ) {
|
|||||||
assert.notEqual( $().scrollLeft( 100 ), null, "jQuery().scrollLeft(100) testing setter on empty jquery object" );
|
assert.notEqual( $().scrollLeft( 100 ), null, "jQuery().scrollLeft(100) testing setter on empty jquery object" );
|
||||||
assert.notEqual( $().scrollTop( null ), null, "jQuery().scrollTop(null) testing setter on empty jquery object" );
|
assert.notEqual( $().scrollTop( null ), null, "jQuery().scrollTop(null) testing setter on empty jquery object" );
|
||||||
assert.notEqual( $().scrollLeft( null ), null, "jQuery().scrollLeft(null) testing setter on empty jquery object" );
|
assert.notEqual( $().scrollLeft( null ), null, "jQuery().scrollLeft(null) testing setter on empty jquery object" );
|
||||||
assert.strictEqual( $().scrollTop(), null, "jQuery().scrollTop(100) testing setter on empty jquery object" );
|
assert.strictEqual( $().scrollTop(), undefined, "jQuery().scrollTop() testing getter on empty jquery object" );
|
||||||
assert.strictEqual( $().scrollLeft(), null, "jQuery().scrollLeft(100) testing setter on empty jquery object" );
|
assert.strictEqual( $().scrollLeft(), undefined, "jQuery().scrollLeft() testing getter on empty jquery object" );
|
||||||
|
|
||||||
// Tests position after parent scrolling (#15239)
|
// Tests position after parent scrolling (#15239)
|
||||||
$( "#scroll-1" ).scrollTop( 0 );
|
$( "#scroll-1" ).scrollTop( 0 );
|
||||||
|
Loading…
Reference in New Issue
Block a user