How to run an .animate immediately after fancybox function
I am trying to open a fancybox
then run an animation on a z-indexed item. I want the .animate function 开发者_高级运维to run automatically after the fancybox
has opened.
to open a fancybox: $("#box").fancybox()
What I need to do is
$("#box").fancybox({
$("#box").animate({left: "200"}, slow)
});
But this clearly won't work. I am still learning jquery and js...
Fancybox has an onComplete
callback.
var box = $("#box")
box.fancybox({
'onComplete': function() { box.animate({left: "200"}, slow); }
});
精彩评论