开发者

jQuery Colorbox background transition effect?

I find the background transition of the jQuery Colorbox very 'hard'. I couldn't find a setting where I can specify a custom transition. Is it possible to create a fade-effect for the backgroun开发者_开发技巧d like Nyro Modal has?


UPDATED 2 with easing effects

DEMO: http://so.lucafilosofi.com/jquery-colorbox-background-transition-effect/

$('.example').colorbox({
    //added to remove initial flickering
    opacity : 0,
    //use the onOpen event...
    onOpen: function() {
        // prevent Overlay from being displayed...
        $('#cboxOverlay,#colorbox').css('visibility', 'hidden');
        // make the overlay visible and
        // re-add all it's original properties!
        $('#cboxOverlay').css({
            'visibility': 'visible',
            'opacity': 0.9,
            'cursor': 'pointer'
            // execute our original animation on the overlay!
            // animate it you can use here all the
            // possible animate combination or plugin...
        }).animate({
            height: ['toggle', 'swing'],
            opacity: 'toggle'
        }, 1000 , function() {
            $('#colorbox').css({
            'visibility': 'visible'
        }).fadeIn(1000);
        });
    }
});
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜