aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavi <xavi.rmz@gmail.com>2011-01-18 12:40:07 -0500
committerXavi <xavi.rmz@gmail.com>2011-01-18 12:40:07 -0500
commit135a384cf3e4cc3671de4cfcced20f294a5667a8 (patch)
tree13caff7496361762668da38158758832e53b2cdd
parent0942b3b3f55c77664f3a72b1e2ae0b58cf108d4c (diff)
downloadjquery-135a384cf3e4cc3671de4cfcced20f294a5667a8.tar.gz
jquery-135a384cf3e4cc3671de4cfcced20f294a5667a8.zip
Bug 7931; cleaned up white space in accordance to style guide
-rw-r--r--src/offset.js15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/offset.js b/src/offset.js
index 660efa234..8696c2051 100644
--- a/src/offset.js
+++ b/src/offset.js
@@ -260,15 +260,15 @@ jQuery.fn.extend({
jQuery.each( ["Left", "Top"], function( i, name ) {
var method = "scroll" + name;
- jQuery.fn[ method ] = function(val) {
+ jQuery.fn[ method ] = function( val ) {
var elem, win;
- if(val === undefined) {
- elem = this[0];
+ if( val === undefined ) {
+ elem = this[ 0 ];
if( !elem ) {
return null;
}
-
+
win = getWindow( elem );
// Return the scroll offset
return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] :
@@ -276,17 +276,16 @@ jQuery.each( ["Left", "Top"], function( i, name ) {
win.document.body[ method ] :
elem[ method ];
}
-
+
// Set the scroll offset
return this.each(function() {
win = getWindow( this );
if ( win ) {
win.scrollTo(
- !i ? val : jQuery(win).scrollLeft(),
- i ? val : jQuery(win).scrollTop()
+ !i ? val : jQuery( win ).scrollLeft(),
+ i ? val : jQuery( win ).scrollTop()
);
-
} else {
this[ method ] = val;
}