diff options
author | Scott González <scott.gonzalez@gmail.com> | 2012-06-15 12:47:12 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2012-06-15 12:47:12 -0400 |
commit | 92fb5567a25080f2064710fc24f0c6c073424cf3 (patch) | |
tree | 641a6f85bf957c07d3c804f5da711028a605bc93 /ui/jquery.ui.effect-transfer.js | |
parent | d569b52838594c3e7e732d31dbf07dc2072edfdb (diff) | |
download | jquery-ui-92fb5567a25080f2064710fc24f0c6c073424cf3.tar.gz jquery-ui-92fb5567a25080f2064710fc24f0c6c073424cf3.zip |
Effects: Renamed all files.
Diffstat (limited to 'ui/jquery.ui.effect-transfer.js')
-rw-r--r-- | ui/jquery.ui.effect-transfer.js | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/ui/jquery.ui.effect-transfer.js b/ui/jquery.ui.effect-transfer.js new file mode 100644 index 000000000..fefa551b4 --- /dev/null +++ b/ui/jquery.ui.effect-transfer.js @@ -0,0 +1,46 @@ +/*! + * jQuery UI Effects Transfer @VERSION + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Transfer + * + * Depends: + * jquery.ui.effect.js + */ +(function( $, undefined ) { + +$.effects.effect.transfer = function( o, done ) { + var elem = $( this ), + target = $( o.to ), + targetFixed = target.css( "position" ) === "fixed", + body = $("body"), + fixTop = targetFixed ? body.scrollTop() : 0, + fixLeft = targetFixed ? body.scrollLeft() : 0, + endPosition = target.offset(), + animation = { + top: endPosition.top - fixTop , + left: endPosition.left - fixLeft , + height: target.innerHeight(), + width: target.innerWidth() + }, + startPosition = elem.offset(), + transfer = $( '<div class="ui-effects-transfer"></div>' ) + .appendTo( document.body ) + .addClass( o.className ) + .css({ + top: startPosition.top - fixTop , + left: startPosition.left - fixLeft , + height: elem.innerHeight(), + width: elem.innerWidth(), + position: targetFixed ? "fixed" : "absolute" + }) + .animate( animation, o.duration, o.easing, function() { + transfer.remove(); + done(); + }); +}; + +})(jQuery); |