diff options
author | Scott González <scott.gonzalez@gmail.com> | 2011-03-09 10:01:07 -0500 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2011-03-09 10:01:07 -0500 |
commit | 3875cf63e4bef49b0da888bc9c8e60b9512cbf60 (patch) | |
tree | 42387525b2207be91b9da7060d5d0de5c9b08f9e /ui/jquery.effects.transfer.js | |
parent | fa7f5d2873b1fef978eab7d9f342c5afa77e061c (diff) | |
parent | 74cff5d57ae35ee05bff1138b1833e896997665d (diff) | |
download | jquery-ui-3875cf63e4bef49b0da888bc9c8e60b9512cbf60.tar.gz jquery-ui-3875cf63e4bef49b0da888bc9c8e60b9512cbf60.zip |
Merge branch 'effects-api' of https://github.com/gnarf37/jquery-ui into gnarf37-effects-api
Diffstat (limited to 'ui/jquery.effects.transfer.js')
-rw-r--r-- | ui/jquery.effects.transfer.js | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/ui/jquery.effects.transfer.js b/ui/jquery.effects.transfer.js index 4b4c41050..79b1577d9 100644 --- a/ui/jquery.effects.transfer.js +++ b/ui/jquery.effects.transfer.js @@ -12,10 +12,11 @@ */ (function( $, undefined ) { -$.effects.transfer = function(o) { - return this.queue(function() { - var elem = $(this), - target = $(o.options.to), +$.effects.transfer = function( o ) { + + return this.queue( function() { + var elem = $( this ), + target = $( o.to ), endPosition = target.offset(), animation = { top: endPosition.top, @@ -24,9 +25,9 @@ $.effects.transfer = function(o) { width: target.innerWidth() }, startPosition = elem.offset(), - transfer = $('<div class="ui-effects-transfer"></div>') - .appendTo(document.body) - .addClass(o.options.className) + transfer = $( '<div class="ui-effects-transfer"></div>' ) + .appendTo( document.body ) + .addClass( o.className ) .css({ top: startPosition.top, left: startPosition.left, @@ -34,9 +35,9 @@ $.effects.transfer = function(o) { width: elem.innerWidth(), position: 'absolute' }) - .animate(animation, o.duration, o.options.easing, function() { + .animate( animation, o.duration, o.easing, function() { transfer.remove(); - (o.callback && o.callback.apply(elem[0], arguments)); + $.isFunction( o.complete ) && o.complete.apply(elem[0], arguments); elem.dequeue(); }); }); |