控制Fancybox2叠加淡入速度 [英] Control Fancybox2 overlay fadeIn speed
问题描述
我正在使用Fancybox v2.0.5,无法弄清楚如何缓慢地淡入叠加层. openSpeed参数仅控制内容的淡入速度,但我希望整个事物以该速度淡入.
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.
这是我的电话:
$(".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.
任何帮助将不胜感激.
推荐答案
您可以在helpers
=> overlay
选项之内进行控制,例如
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 (2012年9月12日):自fancybox v2.1起,选项helpers =>overlay=>speedIn
已被删除.它对于v2.0.6及更低版本仍然有效.
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.
这篇关于控制Fancybox2叠加淡入速度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!