开发者

jQuery colorbox. Custom closing animation

I wanted to override default animation of colorbox popup. I've easily managed to slide it out from any position on the page, that creates an illusion that it's poping out from inside an element, and user can see where the data is coming from.

   onOpen: function () {
            $('#colorbox').css({ 'left': $(element).offset().left + 'px', 'top': $(element).offset().top + 'px' });
        }

Now, it works when it gets opened. At closing time it just fades out. But I want it disappear t开发者_StackOverflowhe same way as it opens. I'm trying to put something like this into onCleanup:

onCleanup: function () {
            $('#colorbox').animate({ 'left': $(element).offset().left + 'px', 'top': $(element).offset().top + 'px', width: '0px', height: '0px' }, { queue: false });

        }

but it doesn't work. It still just fades out. Help me please.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜