-/*
- * jQuery UI Position 1.8.18
+/*!
+ * jQuery UI Position 1.8.21
*
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
$.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 );
});