X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Foffset.js;h=c7f26d1c803943c64c7ca68b2831360be35d745a;hb=6f2f1830a4cbf8c9a6a74e80e920915f87673119;hp=5c600cc2e9617e8d1b99a2aebb03288660a83d7b;hpb=464535e0965d5de617a24e608a2d05393194c3fd;p=jquery.git diff --git a/src/offset.js b/src/offset.js index 5c600cc..c7f26d1 100644 --- a/src/offset.js +++ b/src/offset.js @@ -53,7 +53,7 @@ jQuery.offset = { var body = document.body, container = document.createElement('div'), innerDiv, checkDiv, table, rules, prop, bodyMarginTop = body.style.marginTop, html = '
'; - rules = { position: 'absolute', top: 0, left: 0, margin: 0, border: 0, width: '1px', height: '1px', visibility: 'hidden' } + rules = { position: 'absolute', top: 0, left: 0, margin: 0, border: 0, width: '1px', height: '1px', visibility: 'hidden' }; for ( prop in rules ) container.style[prop] = rules[prop]; container.innerHTML = html; @@ -131,9 +131,9 @@ jQuery.each( ['Left', 'Top'], function(i, name) { var method = 'scroll' + name; jQuery.fn[ method ] = function(val) { - if (!this[0]) return; + if (!this[0]) return null; - return val != undefined ? + return val !== undefined ? // Set the scroll offset this.each(function() {