Merge branch 'master' of https://github.com/inukshuk/jquery into inukshuk-master
Conflicts: test/unit/offset.js
This commit is contained in:
commit
0d755dff13
|
@ -186,11 +186,13 @@ jQuery.offset = {
|
||||||
// need to be able to calculate position if either top or left is auto and position is either absolute or fixed
|
// need to be able to calculate position if either top or left is auto and position is either absolute or fixed
|
||||||
if ( calculatePosition ) {
|
if ( calculatePosition ) {
|
||||||
curPosition = curElem.position();
|
curPosition = curElem.position();
|
||||||
|
curTop = curPosition.top;
|
||||||
|
curLeft = curPosition.left;
|
||||||
|
} else {
|
||||||
|
curTop = parseFloat( curCSSTop ) || 0;
|
||||||
|
curLeft = parseFloat( curCSSLeft ) || 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
curTop = calculatePosition ? curPosition.top : parseInt( curCSSTop, 10 ) || 0;
|
|
||||||
curLeft = calculatePosition ? curPosition.left : parseInt( curCSSLeft, 10 ) || 0;
|
|
||||||
|
|
||||||
if ( jQuery.isFunction( options ) ) {
|
if ( jQuery.isFunction( options ) ) {
|
||||||
options = options.call( elem, i, curOffset );
|
options = options.call( elem, i, curOffset );
|
||||||
}
|
}
|
||||||
|
|
|
@ -433,7 +433,33 @@ test("offsetParent", function(){
|
||||||
equals( div[1], jQuery("#nothiddendiv")[0], "The div is the offsetParent." );
|
equals( div[1], jQuery("#nothiddendiv")[0], "The div is the offsetParent." );
|
||||||
});
|
});
|
||||||
|
|
||||||
function testoffset( name, fn ) {
|
test("fractions (see #7730 and #7885)", function() {
|
||||||
|
expect(2);
|
||||||
|
|
||||||
|
jQuery('body').append('<div id="fractions"/>');
|
||||||
|
|
||||||
|
var expected = { top: 1000, left: 1000 };
|
||||||
|
var div = jQuery('#fractions');
|
||||||
|
|
||||||
|
div.css({
|
||||||
|
position: 'absolute',
|
||||||
|
left: '1000.7432222px',
|
||||||
|
top: '1000.532325px',
|
||||||
|
width: 100,
|
||||||
|
height: 100
|
||||||
|
});
|
||||||
|
|
||||||
|
div.offset(expected);
|
||||||
|
|
||||||
|
var result = div.offset();
|
||||||
|
|
||||||
|
equals( result.top, expected.top, "Check top" );
|
||||||
|
equals( result.left, expected.left, "Check left" );
|
||||||
|
|
||||||
|
div.remove();
|
||||||
|
});
|
||||||
|
|
||||||
|
function testoffset(name, fn) {
|
||||||
|
|
||||||
test(name, function() {
|
test(name, function() {
|
||||||
// pause execution for now
|
// pause execution for now
|
||||||
|
|
Loading…
Reference in a new issue