jquery delay image animate -
I am from Argentina and I have a question, hope you can help me.
I am creating a slider and I have a problem with the following code.
var tmpImg = new image (); TmpImg.src = 'http: //mlm-s1-p.mlstatic.com/reloj-movado-movimien-de-cuarzo-con-caja-dorada-y-tapa-acero-4269-MLM4903532600_082013-F.jpg'; TmpImg.onload = function () {var alto = tmpImg.height; Var Largo = TMPIMG Wide; $ ("#photo") Animate ({width: Largo, height: alto,}, {duration: 500, phase: function () {$ ('# photo'). CSS ({condition: 'full', left: ($ (window). () - $ ('# photo') External Wide ()) / 2, top: ($ (window) .hit () - $ ('# photo'). External head ())}};} }); . ("# Photo") $ enclosed (tmpImg); }; Only interest in this thing is that the photo loads when the animation is over. $ ("#photos"). Attached (tmpImg); Sorry for English and thank you very much.
You have to preload your photo before it's shown. Example with jQuery:
$ (new image) Attr ('src', '/img/preload_me_plz.jpg'). Load (function () {Warning ('I'm ready!');});
Comments
Post a Comment