JQuery Colorbox background transition effect?

I find the jQuery Colorbox background transition to be very "tough." I could not find the settings where I can specify a custom transition. Is it possible to create a fading effect for a background like Nyro Modal ?

+3
source share
1 answer

UPDATED 2 with debilitating effects

DEMO: http://so.devilmaycode.it/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 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);
        });
    }
});
+11
source

Source: https://habr.com/ru/post/1743871/


All Articles