开发者

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); }
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜