(function ($, undefined) {//-----closures, cooked can not be cooked again $.effects.effect.transfer = function (o, done) {var Elem = $ (this), Targe T = $ (o.to),//finally moved to the target element targetfixed = target.css ("position") = = = "fixed", BODY = $ ("bod Y "), Fixtop = targetfixed? Body.scrolltop (): 0,fixleft = targetfixed? Body.scrollleft (): 0,endposition = Target.Offset (), animation = {Top:endposition.top-fixtop, left:endposition.left-f Ixleft, Height:target.innerHeight (), width:target.innerWidth ()},startposition = Elem.offset (), transfer = $ (' <div class= "Ui-effects-transfer" ></div> ")//--------------construct animation elements. 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"//---------------Positioning}). Animate (animation, o.duration, o.easing, function () {transfer.remove ();//- --------------end of animation removal done (); ---animation completed});}) (Jquery);
A glimpse of jQueryUI animation jquery.ui.effect-transfer.js