jQuery Colorbox后台过渡效果? [英] jQuery Colorbox background transition effect?

查看:67
本文介绍了jQuery Colorbox后台过渡效果?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现jQuery Colorbox的背景转换非常难。我找不到可以指定自定义转换的设置。 是否可以为背景创建淡入淡出效果,例如 Nyro Modal

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 background like Nyro Modal has?

推荐答案

更新2 带缓动效果

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

这篇关于jQuery Colorbox后台过渡效果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆