问题
I'm using Fancybox v2.0.5 and can't figure out how to fade in the overlay slowly. The openSpeed parameter only controls the content fade speed, but I want the entire thing fading in at that speed.
Here is my call:
$(".fancybox").fancybox({
prevEffect : 'none',
nextEffect : 'none',
fitToView : false,
autoSize : true,
openEffect : 'fade',
openSpeed : 1500,
helpers : {
overlay : {
opacity : 0.9,
css : {
'background-color' : '#fff'
}
}
}
});
I'm thinking one of the callbacks that fire before the content is loaded is the key, but I can't seem to target the overlay from any of these.
Any help would be greatly appreciated.
回答1:
You control that within the helpers
=>overlay
option like
helpers: {
overlay: {
opacity : 0.9,
css : {'background-color' : '#fff'},
speedIn: 1500, //<-- here you control the overlay speedIn
speedOut: 1500//<-- here you control the overlay speedOut
} // overlay
} // helpers
EDIT (Sept 12, 2012) : The option helpers =>overlay=>speedIn
has been removed since fancybox v2.1. It's still valid for v2.0.6 and below.
来源:https://stackoverflow.com/questions/9904443/control-fancybox2-overlay-fadein-speed