我发现jQuery Colorbox的背景转换非常“难”。我找不到可以指定自定义转换的设置。 是否可以为Nyro Modal之类的背景创建淡入淡出效果?
答案 0 :(得分:11)
更新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);
});
}
});