Control Fancybox2 overlay fadeIn speed

旧城冷巷雨未停 提交于 2019-12-08 07:27:23

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!