X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Foffset.js;h=cc1b8744030ceb74b53bfd776336ea3bf510a5db;hb=434b87b8a233eb24ec773de801f3adb460fbd0f4;hp=5c600cc2e9617e8d1b99a2aebb03288660a83d7b;hpb=464535e0965d5de617a24e608a2d05393194c3fd;p=jquery.git diff --git a/src/offset.js b/src/offset.js index 5c600cc..cc1b874 100644 --- a/src/offset.js +++ b/src/offset.js @@ -50,10 +50,10 @@ else jQuery.offset = { initialize: function() { if ( this.initialized ) return; - var body = document.body, container = document.createElement('div'), innerDiv, checkDiv, table, rules, prop, bodyMarginTop = body.style.marginTop, + var body = document.body, container = document.createElement('div'), innerDiv, checkDiv, table, td, 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() {