Skip to content
Permalink
Browse files

Bug 7931; cleaned up white space in accordance to style guide

  • Loading branch information
xavi- committed Jan 18, 2011
1 parent 0942b3b commit 135a384cf3e4cc3671de4cfcced20f294a5667a8
Showing with 7 additions and 8 deletions.
  1. +7 −8 src/offset.js
@@ -260,33 +260,32 @@ 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" ] :
jQuery.support.boxModel && win.document.documentElement[ method ] ||
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;
}

0 comments on commit 135a384

Please sign in to comment.
You can’t perform that action at this time.