Position: Patch .offset( fn ) setter for jQuery 1.3.2. Fixes #8254 - Position module throws uncaught exception on IE8 with jQuery 1.3.2.

This commit is contained in:
Scott González 2012-05-08 17:44:59 -04:00
parent b676d59561
commit 3cf2b7c45f

View File

@ -243,7 +243,12 @@ if ( !$.offset.setOffset ) {
$.fn.offset = function( options ) {
var elem = this[ 0 ];
if ( !elem || !elem.ownerDocument ) { return null; }
if ( options ) {
if ( options ) {
if ( $.isFunction( options ) ) {
return this.each(function( i ) {
$( this ).offset( options.call( this, i, $( this ).offset() ) );
});
}
return this.each(function() {
$.offset.setOffset( this, options );
});